Big issue with Timage/TBitmap, PNG under Linux lazarus / 39-Graphics ---------------------------------------------------------------------- BeanzMaster · 2020-05-11 15:20 Hi to all, i've made a little freecell clone with Lazarus 2.0.8 , it work like a charm under Windows 10 64 bit. But under Linux the image are black. So why a little simple project like this, don't work properly under Linux ?  How to do for fixing Bitmap drawing with linux in a simply way? You can download full source for testing here :  https://my.pcloud.com /publink/show?code=XZMgRdkZLuwYrHbIbfQLcG9WH8zvWumgVgnX Thanks in advance ---------------------------------------------------------------------- circular · 2020-05-11 17:07 Hi there PixelFormat is buggy. Do not modify it. When accessing pixels, read the RawImage description to know where the channels are: Code: Delphi  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  function NegateBitmap(SrcBmp : TBitmap) : TBitmap; Var  bytesPerPixel, redOffset, greenOffset, blueOffset: byte;  DstPtr : PByte;  x,y : Integer; begin   Result := TBitmap.Create;   Result.Assign(srcBmp);   Result.BeginUpdate;   bytesPerPixel := Result.RawImage.Description.BitsPerPixel div 8;   redOffset := Result.RawImage.Description.RedShift div 8;   greenOffset := Result.RawImage.Description.GreenShift div 8;   blueOffset := Result.RawImage.Description.BlueShift div 8;   {$IFNDEF ENDIAN_LITTLE}   redOffset := bytesPerPixel - 1 - redOffset;   greenOffset := bytesPerPixel - 1 - greenOffset;   blueOffset := bytesPerPixel - 1 - blueOffset;   {$ENDIF}   for y :=  0 to Result.Height - 1 do   begin     DstPtr := Result.RawImage.GetLineStart(y);     for x := 0 to Result.Width - 1 do     begin;       (DstPtr+blueOffset)^ := not (DstPtr+blueOffset)^;       (DstPtr+greenOffset)^ := not (DstPtr+greenOffset)^;       (DstPtr+redOffset)^ := not (DstPtr+redOffset)^;       inc(DstPtr, bytesPerPixel);     end;   end;   Result.EndUpdate; end; ---------------------------------------------------------------------- BeanzMaster · 2020-05-11 18:34 Hi, thanks for the tips but the problem is not wiht the negate functions So if pixelformat is buggy with Linux how to display transparent bitmap correctly ? I hope this bug will solve in next version 2.2 of Lazarus. Thanks ---------------------------------------------------------------------- circular · 2020-05-11 20:21 Quote from: BeanzMaster on May 11, 2020, 08:34:57 pmHi, thanks for the tips but the problem is not wiht the negate functions Well it is with the Negate function as well because it relies on the pixel format. QuoteSo if pixelformat is buggy with Linux how to display transparent bitmap correctly ?With BGRABitmap? ---------------------------------------------------------------------- wp · 2020-05-11 21:06 Great game! You should put it on the Application Gallery In Linux I get rid of the black images when I set all PixelFormats to pf24bit or do not set it at all. For the NegateBitmap procedure I use an intermedate LazIntfImage for safety. ---------------------------------------------------------------------- BeanzMaster · 2020-05-12 15:46 Quote from: wp on May 11, 2020, 11:06:50 pmGreat game! You should put it on the Application Gallery In Linux I get rid of the black images when I set all PixelFormats to pf24bit or do not set it at all. For the NegateBitmap procedure I use an intermedate LazIntfImage for safety. Thanks wp, yes by uses pf24bit it work, and the copymode to. But on Windows copymode don't work. I'll make test with pf24bit. And yes why not tu put it in the Application Gallery. I've also made the possibility to select and move more than one card