Ich habe ein DC von der Form und abgesondert geschaffen HPALETTE. Ich schaffe TBitmap und DIBSection auf folgende Weise:
Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| var BitmapInfo: TBitmapInfo; BitmapBits: Pointer; CanvasHandle: HDC; ... CanvasHandle := MyForm.Handle; ... ABitmap := TBitmap.Create; ABitmap.Handle := CreateDIBSection( CanvasHandle, BitmapInfo, DIB_RGB_COLORS, BitmapBits, 0, 0); ... |
Weiter lese ich die bitmap bits in das Pointer (BitmapBits). Wenn ich ABitmap zeichne, werden seiner Farbe verzerrt. Warum?
Wenn ich mich die Palette anmasse, hängenbleibt ganzes System.
Quelltext
1: 2:
| If (HIconPalette <> 0) and (BitMapInfoHeader.biBitCount <= 8) then ABitmap.Palette := HIconPalette; |
Warum?