problems using GetDataLineStart of tlazintfimage with 24bits tbitmap in linux lazarus / 39-Graphics ---------------------------------------------------------------------- dcelso · 2013-01-28 14:37 Hello to all, I have another problem in linux. When I convert a Bitmat in lazintfimage, the color depth is automatically converted in 32 bits, so when I try to use getdatalinestart to run it 3 bytes by 3 bytes, to change it directly my program fails. In windows It run correctly, the conversion to a lazinftfimage does not change the color deph. So, this kind of problems, do mys applications 0% portables bettwen linux and windows , . My example is the next Code: [Select]unit Unit1; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,   StdCtrls, Buttons, IntfGraphics; type   { TForm1 }   TForm1 = class(TForm)     BitBtn1: TBitBtn;     Image1: TImage;     Label1: TLabel;     Memo1: TMemo;     procedure BitBtn1Click(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var   Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.BitBtn1Click(Sender: TObject); var   bmp : TBitmap;   lazBmp : TLazIntfImage;   pointer : PByteArray;   i,j : integer;   tmpStr : String;   value : byte; begin   bmp:= TBitmap.Create;   bmp.PixelFormat:=pf24bit;   bmp.SetSize(4,4);   bmp.canvas.Brush.Color:=clRed;   bmp.Canvas.FillRect(0,0,4,1);   bmp.canvas.Brush.Color:=clLime;   bmp.Canvas.FillRect(0,1,4,2);   bmp.canvas.Brush.Color:=clYellow;   bmp.Canvas.FillRect(0,2,4,3);   bmp.canvas.Brush.Color:=clBlue;   bmp.Canvas.FillRect(0,3,4,4);   Image1.Picture.Assign(bmp);   tmpStr:='';   lazBmp := bmp.CreateIntfImage;   for j:=0 to lazBmp.Height -1 do   begin     pointer:= lazBmp.GetDataLineStart(j);     for i:=0 to lazBmp.Width -1  do     begin         value:=pointer^[i*3];         tmpStr:=tmpStr+IntToHex(value,2);         value:=pointer^[i*3+1];         tmpStr:=tmpStr+IntToHex(value,2);         value:=pointer^[i*3+2];         tmpStr:=tmpStr+IntToHex(value,2);         tmpStr:=tmpStr+',';     end;     Memo1.Lines.Add(tmpStr);     tmpStr:='';   end;   label1.Caption:=inttostr(lazBMP.DataDescription.BitsPerPixel);   lazBMP.free; end; end. and the form Code: [Select]object Form1: TForm1   Left = 352   Height = 240   Top = 264   Width = 320   Caption = 'Form1'   ClientHeight = 240   ClientWidth = 320   LCLVersion = '1.1'   object Image1: TImage     Left = 8     Height = 111     Top = 8     Width = 127     Stretch = True   end   object BitBtn1: TBitBtn     Left = 191     Height = 30     Top = 47     Width = 75     Caption = 'BitBtn1'     OnClick = BitBtn1Click     TabOrder = 0   end   object Memo1: TMemo     Left = 12     Height = 98     Top = 128     Width = 276     TabOrder = 1   end   object Label1: TLabel     Left = 201     Height = 15     Top = 95     Width = 34     Caption = 'Label1'     ParentColor = False   end end