Re: AW: [Visualoberon-win32] Bitmaps
Status: Beta
Brought to you by:
tteuling
From: Stewart G. <sgr...@ip...> - 2001-06-12 06:51:03
|
tim...@ma... wrote: > > Hallo! > > > For me, colours drawn into bitmaps don't come out when copied into a > > window. > > I didn't have that problems when checking functionality using the WireFrame > stuff in XTest, but it only uses black and white. > > Perhaps a color allocation problem? But colors aren't bitmap local, they are > global > to the programm!? After a lot of detective work, I finally found the problem. Its rather subtle. It seems that CreateCompatibleBitmap requires the handle on the original DC, *not* the compatible DC returned by CreateCompatibleDC. The bitmap created with the compatible DC appears to be monochrome so when it it blitted into the window DC the result is a dithered image that maps black/white to the default foreground/background colour. I guess Windows does not regard "compatibility" as transitive. The attached Display.Mod corrects the problem in CreateBitmap. Cheers, Stewart |