Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CreateCompatibleBitMap and Win2000
Message
 
To
19/12/2001 14:21:53
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00596108
Message ID:
00596381
Views:
30
>George,
>The printer resolution is set to max. The problem is that the function insists on trying to print the screen background colors. This turns the output created on a DotMatrix printer into a gray haze. According to the documentation of "CreateCompatibleBitmap" it should strip out this element of the bitmap if the device is not capable of printing in color - at least that is my understanding of the documention. All I can say is that the same proc works on Win98 machines and does not work on Win2000/XP machines and my *** is apparently in a sling because I just sent this out to 500 customers.

Calvin,

First, I understand and sympathize, however, it doesn't change my orginal statement that I don't think the problem is CreateCompatibleBitmap(). My suspicion here is that the call to CreateDC() is the problem. If we could see a code snippet of the call to that, especially including the initialization of the DEVMODE structure, it might help solve the problem.

Now the reason I say this is that CreateCompatibleBitmap() creates the bitmap in correspondence to the characteristics of the device context that's passed to it. If CreateDC() isn't sent the proper information, it will not create an appropriate device context. If CreateDC() isn't used or fails, and CreateCompatibleDC() is called with a null (which CreateDC() would return in case of failure), CreateCompatibleDC() returns a device context which is compatible with the application's current screen. This would explain why you're getting color when CreateCompatibleBitmap creates the output.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform