![]() |
HBITMAP ---> TBitmap?
Wie kann ich aus HBITMAP ein TBitmap machen?
|
Re: HBITMAP ---> TBitmap?
in dem du ein TBitmap creirst und das Handle zuweist
Delphi-Quellcode:
var LBitmap: TBitmap;
begin LBitmap := TBitmap.Create; LBitmap.Handle := YourHBitmap; //do anything with LBitmap LBitmap.Free; |
Re: HBITMAP ---> TBitmap?
Zitat:
Delphi-Quellcode:
procedure FormX.DiesUndDas...
var TheBitmap: TBitmap { => HBITMAP } begin TheBitmap.Width := 320; TheBitmap.Height := 240; TheBitmap.PixelFormat := pf24Bit; // in das Bitmap Zeichnen TheBitmap.Canvas.Rectangle(10, 10, 20,20); ... ... end; |
Re: HBITMAP ---> TBitmap?
Danke werd ich glei mal ausprobieren
|
Re: HBITMAP ---> TBitmap?
@turboPASCAL: HBitmap ist nicht gleich TBitmap. HBitmap ist einfach ein HandleTyp der eben für das WindowsBitmap steht. Wäre HBitmap = TBitmap dann wäre TBitmap ja rekursiv verschaltet, denn TBitmap hat das Property Handle was vom Typ HBitmap ist. Und wenn das nur ein TBitmap wäre, könnte man es ja zu TBitmap casten und dann wieder auf Handle zugreifen und so weiter.
|
Re: HBITMAP ---> TBitmap?
@SirThornberry
So war es auch nicht gemeint, etwas blöde Darstellung, sorry. |
Re: HBITMAP ---> TBitmap?
@turboPASCAL: ok, dann hab ich's falsch verstanden...
|
Re: HBITMAP ---> TBitmap?
Bei TBitmap kommt es immer darauf an in welchem Scope du es betrachtest. Wenn du also den Scope-Operator nimmst und Windows.TBitmap angibst, ist das kein Objekt mehr, sondern ein record:
Delphi-Quellcode:
Ein Record ist zwar kein Handle, aber es ist auch keine Klasse ;)
{ Bitmap Header Definition }
PBitmap = ^TBitmap; {$EXTERNALSYM tagBITMAP} tagBITMAP = packed record bmType: Longint; bmWidth: Longint; bmHeight: Longint; bmWidthBytes: Longint; bmPlanes: Word; bmBitsPixel: Word; bmBits: Pointer; end; TBitmap = tagBITMAP; {$EXTERNALSYM BITMAP} BITMAP = tagBITMAP; Von was sprechen wir hier also, wenn wir von TBitmap sprechen? |
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:51 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz