"ImageList->GetImageBitmap()" Wie Bild in ein TImage kopieren?
-
Hallo Leute,
Ich will gern eine ImageList in ein Image kopieren.
Komme aber mit "GetImageBitmap" nicht klar.
Könnte mir da einer ein Beispiel geben?
-
-
Hallo akari,
Aber ich will ja die gesamte Liste als ein Bild anzeigen.

Da dachte ich mir das GetImageList das richtige ist.
Komme wie gesagt aber mit dem Bitmap Handle nicht klar.P.S. Ich habe nartürlich vorher gesucht!

-
Frido72 schrieb:
Aber ich will ja die gesamte Liste als ein Bild anzeigen.
Du könntest z.B. mittels TImageList::Draw nacheinander die einzelnen Bilder der Liste auf den Canvas des Zielbildes malen. Über X,Y steuerst du dabei die Anordnung der "Kacheln".
-
Frido72 schrieb:
Könnte mir da einer ein Beispiel geben?
HBITMAP hBmp = ImageList1->GetImageBitmap(); int w = ImageList1->Width; int h = ImageList1->Height * ImageList1->Count; Graphics::TBitmap* bitmap = new Graphics::TBitmap(); bitmap->Handle = hBmp; bitmap->PixelFormat = pf24bit; Image1->Width = w; Image1->Height = h; Image1->Picture->Graphic = bitmap; delete bitmap;es geht auch ohne Zwischenbitmap:
HBITMAP hBmp = ImageList1->GetImageBitmap(); int w = ImageList1->Width; int h = ImageList1->Height * ImageList1->Count; Image1->Height = h; Image1->Width = w; Image1->Picture->Bitmap->Handle = hBmp; Image1->Picture->Bitmap->PixelFormat = pf24bit;mfg
kpeter
-
kpeter
Vielen Dank!!

Funktioniert Super.
Und noch ein guten Rutsch.