I have the necessity to store in a buffer the bits image so I use this code:
The code work well under Windows but under Linux I get an exception on Move instruction.
I use Lazarus 0.9.26 & fpc 2.2.2, WinXP+SP2, Linux Fedora Core 8.
In the attached file there is the complete source code.
Can you help me?
Thanks & goodbye
Code Select
...
FBitmap: TImagingBitmap;
FImage: TSingleImage;
s: LongInt;
gbuff: Pointer;
...
FImage := TSingleImage.Create;
FBitmap := TImagingBitmap.Create;
Image.Picture.Graphic := FBitmap;
...
FImage.LoadFromFile('test.jpg');
Image.Picture.Graphic.Assign(FImage);
s := FImage.Size;
GetMem(gbuff, s);
{$ifdef Linux}
Move(FImage.Bits, gbuff, s);
{$endif}
{$ifdef Win32}
CopyMemory(gbuff, FImage.Bits, s);
{$endif}
The code work well under Windows but under Linux I get an exception on Move instruction.
I use Lazarus 0.9.26 & fpc 2.2.2, WinXP+SP2, Linux Fedora Core 8.
In the attached file there is the complete source code.
Can you help me?
Thanks & goodbye