Hi everyone, I'm a new user of Lazarus and FPC, and I'm have some trouble when I try to mirror a bitmap along the y axe.
I'm working in window7, professional edition.
I have the same code in Delphi and it works fine. But the similar code (below) in Lazarus doesnt work.
I thank a lot for any help or tip.
I have implemented the following code in Lazarus:
also follow the original bitmap and output using the sent code.
Thanks
csgm
{-----------------------------------------------------------------}
type
TRGBArray = array[0..3] of TRGBTriple;
pRGBArray = ^TRGBArray;
procedure MirrorVertical(Bitmap: TBitmap);
var i, j, w: Integer;
In: pRGBArray;
Out: pRGBArray;
begin
w := bitmap.width * sizeof(TRGBTriple);
GetMem(In, w);
auxLBMP:=bitmap.CreateIntfImage;
for j := 0 to Bitmap.Height - 1
do begin
move(auxLBMP.GetDataLineStart(j)^, In^, w);
Out := auxLBMP.GetDataLineStart(j);
for i := 0 to Bitmap.Width - 1
do Out := In[Bitmap.Width - 1 - i];
end;
bitmap.LoadFromIntfImage(auxLBMP);
auxLBMP.Free;
FreeMem(In);
end;
{-----------------------------------------------------------------}