Einzelnen Beitrag anzeigen

Medium

Registriert seit: 23. Jan 2008
3.686 Beiträge
 
Delphi 2007 Enterprise
 
#6

Re: [GDI] Offscreen Bitmap

  Alt 1. Aug 2008, 21:13
MSDN-Library durchsuchenCreateCompatibleDC
Zitat:
A memory DC exists only in memory. When the memory DC is created, its display surface is exactly one monochrome pixel wide and one monochrome pixel high. Before an application can use a memory DC for drawing operations, it must select a bitmap of the correct width and height into the DC. To select a bitmap into a DC, use the CreateCompatibleBitmap function, specifying the height, width, and color organization required.
Das klingt exakt nach deinem Problem. Zudem:
Zitat von msdn zu CreateCompatibleBitmap():
The color format of the bitmap created by the CreateCompatibleBitmap function matches the color format of the device identified by the hdc parameter. This bitmap can be selected into any memory device context that is compatible with the original device.
D.h. irgendwie scheint dein DC vermurkst zu sein. Probier doch einfach mal mir zur Liebe nochmal statt "hDC = CreateCompatibleDC(GetDC(NULL));" "hDC = CreateCompatibleDC(NULL);", weil das wäre zumindest laut msdn der dokumentierte richtige Weg.
"When one person suffers from a delusion, it is called insanity. When a million people suffer from a delusion, it is called religion." (Richard Dawkins)
  Mit Zitat antworten Zitat