Recent

Author Topic: Proper way to use TBitmap.ScanLine on Unixes  (Read 2571 times)

furious programming

  • Sr. Member
  • ****
  • Posts: 354
  • I click a little.
Proper way to use TBitmap.ScanLine on Unixes
« on: April 05, 2019, 10:19:06 pm »
This topic applies to my game described in this thread: Deep Platformer — looking for people for cross-platform testing. I have a big problem with its adaptation to Unix. That's why I prepared a small test application.

This test program contains copied game code that applies to copying and painting bitmaps using TBitmap.ScanLine, using or without scaling, as well as transparency support in the form of skipping pixels in the color of clFuchsia. For the test uses bitmaps borrowed from the game (which are originally contained within binary files).

After running this application, the content of the window should look exactly like in screenshot and do not cause any leaks, which should inform the window caused by using the HeapTrc unit (second screenshot).

Under Windows, my game and this test application work perfectly, but the game crashes under Linux. Probably the problem is TBitmap.ScanLine, so I am asking you to test the test program (under different platforms, if you want under Windows too), which sources I add to the attachments of this post.

The structure describing a single pixel and a pixels row are in the CustomUtils unit:

Code: Pascal  [Select]
  1. type
  2.   TBitmapPixel = record
  3.     B, G, R {$IFNDEF WINDOWS}, A {$ENDIF}: UInt8;
  4.   end;
  5.  
  6. type
  7.   PBitmapLine = ^TBitmapLine;
  8.   TBitmapLine = array [UInt16] of TBitmapPixel;

The CustomUtils unit contains all the procedures for copying and painting bitmaps.

If anyone knows if the problem is the type declarations used in conjunction with ScanLine, or the way iterated by pixels, or something else, I would ask for directions. I hope that this application will allow to reproduce existing errors in the game.

Thank you for help.
« Last Edit: April 05, 2019, 10:35:03 pm by furious programming »
Lazarus 2.0.4 with FPC 3.0.4, Windows XP (all 32-bit)

lucamar

  • Hero Member
  • *****
  • Posts: 2086
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #1 on: April 05, 2019, 10:32:22 pm »
Ouch! Man, don't post a project for Unix with hardcoded "\" in the paths to files. I just got one error for each:
LoadFromFile('graphics\...')
 :)

I'll tell you more after I correct that.

ETA: Ok, this is how it looks in this machine*

* Ubuntu 12.04 - i386
uname = Linux 3.2.0-126-generic #169-Ubuntu SMP i686
« Last Edit: April 05, 2019, 10:40:44 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

furious programming

  • Sr. Member
  • ****
  • Posts: 354
  • I click a little.
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #2 on: April 05, 2019, 10:35:19 pm »
Damn it... I did not pay attention to it in a hurry... Ok, I updated the sources.

But Windows supports both separators, so I can harcode / instead of use DirectorySeparator. 8)
« Last Edit: April 05, 2019, 10:37:00 pm by furious programming »
Lazarus 2.0.4 with FPC 3.0.4, Windows XP (all 32-bit)

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #3 on: April 05, 2019, 10:50:09 pm »
Raspbian

furious programming

  • Sr. Member
  • ****
  • Posts: 354
  • I click a little.
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #4 on: April 05, 2019, 11:30:45 pm »
@Thausand: can you provide a screenshot in form of PNG or BMP file?

I don't see the details because of strong image compression.


@lucamar: thanks for the test, I see a few problems.

The first is that the ScanLine used on the unmodified bitmap loaded from the file work incorrectly. This can be seen in the example of drawing FP letters, fireflies, FPR logo and black layer (lower left corner). So ScanLine does not mork properly.

The second problem is unwanted antialiasing support in the method of copying a layer fragment. The interesting thing is that after painting a fragment of a layer on a bitmap (using TCanvas.CopyRect), it can then be properly copied using ScanLine.

TCanvas.StretchDraw works perfectly (hero sprite is drawn properly).


One question — what should be changed so that simple copying of images with ScanLine works properly?
« Last Edit: April 05, 2019, 11:52:25 pm by furious programming »
Lazarus 2.0.4 with FPC 3.0.4, Windows XP (all 32-bit)

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #5 on: April 05, 2019, 11:48:30 pm »
@Thausand: can you provide a screenshot in form of PNG or BMP file?

I don't see the details because of strong image compression.
Sorry. I forget you want see close. Hope this better.


furious programming

  • Sr. Member
  • ****
  • Posts: 354
  • I click a little.
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #6 on: April 06, 2019, 12:01:53 am »
@Thausand: thank you, almost the same incorrect result as @lucamar's — and that's good. 8)

I disable antialiasing for all bitmaps and set the pixel format manually — this should help. Fresh sources with the corrected code have been added to the attachments, please test them.
« Last Edit: April 06, 2019, 12:04:58 am by furious programming »
Lazarus 2.0.4 with FPC 3.0.4, Windows XP (all 32-bit)

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #7 on: April 06, 2019, 12:17:53 am »
New test result

furious programming

  • Sr. Member
  • ****
  • Posts: 354
  • I click a little.
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #8 on: April 06, 2019, 12:25:08 am »
@Thausand: go to the form constructor and replace pf32bit with pf24bit for each bitmap and test again.
« Last Edit: April 06, 2019, 12:32:53 am by furious programming »
Lazarus 2.0.4 with FPC 3.0.4, Windows XP (all 32-bit)

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #9 on: April 06, 2019, 12:53:23 am »
@Thausand: go to the form constructor and replace pf32bit with pf24bit for each bitmap and test again.
Then same picture as first picture.

If change 3 byte pixel then look better "fp" but rest not.

Some picture 24 bit, some 32 bit. No can change pixelformat.

This log pf32bit. 1 = after TBitmap.Create, 2 = after TBitmap.LoadFromStream 3 = after TBitmap.PixelFormat = pf32bit
Code: [Select]
FLetterF.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterF.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=9 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->28 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterF.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=9 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->28 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterP.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterP.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=9 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->28 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterP.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=9 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->28 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FHero.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FHero.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FHero.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FFirefly.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FFirefly.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=8 Height=8 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->24 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FFirefly.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=8 Height=8 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->24 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLayer.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLayer.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=976 Height=384 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->2928 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->122 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLayer.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=976 Height=384 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->2928 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->122 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLogo.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLogo.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=74 Height=17 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->224 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->10 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLogo.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=74 Height=17 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->224 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->10 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferMaster.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferMaster.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=600 Height=400 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->2400 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->75 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferMaster.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=32 Width=600 Height=400 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->2400 RedPrec=8 RedShift=0 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=16 AlphaPrec=8 AlphaShift=24 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->75 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferSlave.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferSlave.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=250 Height=200 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->1000 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->32 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferSlave.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=32 Width=250 Height=200 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->1000 RedPrec=8 RedShift=0 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=16 AlphaPrec=8 AlphaShift=24 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->32 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
See BitsPerPixel. Not same because no always load pic. and no can change PixelFormat

Create bitmap then PixelFormat depend device/widget
Load bitmap is change pixelformat. Make set not work

new log new post, not fit  :'(
« Last Edit: April 06, 2019, 12:55:40 am by Thausand »

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #10 on: April 06, 2019, 12:53:42 am »
here (same) log but pf24bit
Code: [Select]
FLetterF.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterF.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=9 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->28 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterF.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=9 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->28 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterP.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterP.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=9 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->28 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLetterP.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=9 Height=10 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->28 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FHero.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FHero.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FHero.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=14 Height=16 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->44 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FFirefly.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FFirefly.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=8 Height=8 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->24 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FFirefly.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=8 Height=8 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->24 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->2 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLayer.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLayer.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=976 Height=384 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->2928 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->122 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLayer.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=976 Height=384 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->2928 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->122 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLogo.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLogo.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=74 Height=17 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->224 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->10 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FLogo.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=74 Height=17 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=24 BytesPerLine->224 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileWordBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->10 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferMaster.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferMaster.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=600 Height=400 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->2400 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->75 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferMaster.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=600 Height=400 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->2400 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->75 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferSlave.1  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=0 Height=0 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->0 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->0 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferSlave.2  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=250 Height=200 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->1000 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->32 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
FBufferSlave.3  Format=ricfRGBA HasPalette->False HasMask->False Depth=24 Width=250 Height=200 BitOrder=riboBitsInOrder ByteOrder=riboLSBFirst LineOrder=riloTopToBottom LineEnd=rileDWordBoundary BitsPerPixel=32 BytesPerLine->1000 RedPrec=8 RedShift=16 GreenPrec=8 GreenShift=8 BluePrec=8 BlueShift=0 AlphaPrec=0 AlphaShift=0 ~~~mask~~~ MaskBitsPerPixel=1 MaskShift=0 MaskLineEnd=rileByteBoundary MaskBitOrder=riboBitsInOrder MaskBytesPerLine->32 ~~~palette~~~ PaletteColorCount=0 PaletteBitsPerIndex=0 PaletteShift=0 PaletteLineEnd=rileTight PaletteBitOrder=riboBitsInOrder PaletteByteOrder=riboLSBFirst PaletteBytesPerLine->0
Can see ?

furious programming

  • Sr. Member
  • ****
  • Posts: 354
  • I click a little.
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #11 on: April 06, 2019, 01:13:36 am »
Yes, I see. I implemented a small patch (small warkaround) — just after loading the bitmap from the file, creates a temporary bitmap, sets its pixel format to pf32bit, paints the original bitmap, and then the temporary bitmap is assigned to the original using the Assign method.

Fresh sources added to the attachments.
Lazarus 2.0.4 with FPC 3.0.4, Windows XP (all 32-bit)

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #12 on: April 06, 2019, 01:28:51 am »
Yes, I see. I implemented a small patch (small warkaround) — just after loading the bitmap from the file, creates a temporary bitmap, sets its pixel format to pf32bit, paints the original bitmap, and then the temporary bitmap is assigned to the original using the Assign method.
That clever trick  :)

In theory work.

Quote
Fresh sources added to the attachments.
i test..... i not sure how tell  :-[ (please close eye)

i not sure have more time test today. I make test tomorow see how temp picture look before and after assign.

Thausand

  • Full Member
  • ***
  • Posts: 234
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #13 on: April 06, 2019, 01:31:10 am »
Sorry i forgot tell. pixels top right moving. they not quiet.

add:

Before forget. I think now need think transparant color, is Transparant is Mask etc.when go 24 to 32. I not have test before.
« Last Edit: April 06, 2019, 01:47:58 am by Thausand »

furious programming

  • Sr. Member
  • ****
  • Posts: 354
  • I click a little.
Re: Proper way to use TBitmap.ScanLine on Unixes
« Reply #14 on: April 06, 2019, 02:11:26 am »
I will try with 24-bit bitmaps, because every time I use these 32-bit, the bitmaps painted on the screen are too wide. Or with the different order of pixel components. Do not know what exactly.

But tomorrow, because today I have enough of Pascal and Linux.
« Last Edit: April 06, 2019, 02:16:22 am by furious programming »
Lazarus 2.0.4 with FPC 3.0.4, Windows XP (all 32-bit)