fcl-image and TImage lazarus / 39-Graphics ---------------------------------------------------------------------- adderthorn · 2023-02-25 16:42 I am working with a library that creates bitmaps using the fcl-image classes, I am trying to integrate this into a GUI application and display these bitmaps, I can't seem to find a way to do this. I've tried doing this with a stream, but it fails on me. Any thoughts? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ABitmap:=LIBRARYCLASS.ToBitmapImage(1, 1);Writer:=TFPWriterBMP.Create; AStream:=TMemoryStream.Create;ABitmap.SaveToStream(AStream, Writer);Image1.Picture.Bitmap.LoadFromStream(AStream, 1); ---------------------------------------------------------------------- wp · 2023-02-25 16:50 Assuming that line 1 in your example is correct, then you simply can assign ABitmap to Image1.Picture: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Image1.Picture.Assign(ABitmap); Your code with the stream should work, too. But you must be aware that the stream.Position is at the end after ABitmap.SaveToStream; therefore, there's nothing to read for Image1.Picture.Bitmap.LoadFromStream. Rewinding the stream should help: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ...ABitmap.SaveToStream(AStream, Writer);AStream.Position := 0;Image1.Picture.Bitmap.LoadFromStream(AStream, 1); ---------------------------------------------------------------------- adderthorn · 2023-02-25 17:21 Thank-you! This was what I needed. Still having an issue (now getting Invalid palette index 0), but I think this is the library I'm using, so I'm doing some more debugging.