transparent bitmaps lazarus / 39-Graphics ---------------------------------------------------------------------- Jo · 2007-11-18 11:01 Is there a way to draw transparent bitmaps? The example for win32 using writing and reading from TMemoryStream gives on wince the following: “Failed to get raw image description from bitmap”. Any ideas how I can go about this? ---------------------------------------------------------------------- Marc · 2007-11-19 10:52 This should work, do you have a code example ? ---------------------------------------------------------------------- Jo · 2007-11-19 12:22 Just copied and adjusted the example. The error is when writing the bitmap to the stream, and the bitmap is drawn correctly if I don't use transparency and streams: procedure TForm1.Button2Click(Sender: TObject); var   buffer: THandle;   bmp: TBitmap;   memstream: TMemoryStream; begin   bmp := TBitmap.Create;   bmp.Width:=32;   bmp.Height:=32;   //bmp.PixelFormat:=pf24Bit ;   Handle := LoadBitmap(hInstance, 'test');   if (buffer = 0) then exit; // Error loading the bitmap   bmp.Handle := buffer;   memstream := TMemoryStream.create;   try     bmp.SaveToStream(memstream);     memstream.position := 0;     bmp.LoadFromStream(memstream);   finally     memstream.free;   end;   bmp.Transparent := True;   bmp.TransparentColor := clblack;   Canvas.Draw(100, 150, bmp);     bmp.Free; // Release allocated resource end; ---------------------------------------------------------------------- Marc · 2007-11-19 13:36 Changing pixelformat doesn't work yet. Only pfDevice is supported. BTW, I hope this is a typo: Code: [Select]Handle := LoadBitmap(hInstance, 'test'); I would expectCode: [Select]buffer := LoadBitmap(hInstance, 'test'); ---------------------------------------------------------------------- Jo · 2007-11-19 15:18 Quote BTW, I hope this is a typo: Yes, it was from testing bmp.Handle:=... The code works fine on win32 compilation but the wince creates the error when writting the bitmap to the stream at: bmp.SaveToStream(memstream); ---------------------------------------------------------------------- Marc · 2007-11-19 15:52 ok, can you bugrep this, with sample code and sample image (otherwise this might get forgotten) ---------------------------------------------------------------------- Jo · 2007-11-20 08:22 ok.