I compile the demo project \Imaging\Demos\ObjectPascal\LCLImager with Lazarus 0.9.25 under WinXPSP2 but I obtain the following error:
E:\SVILUPPO\Imaging\Source\ImagingComponents.pas(117,14) Error: There is no method in an ancestor class to be overridden: "TImagingGraphicForSave.GetDefaultMimeType:AnsiString"
Can you help me?
Goodbye & thanks
Looks like they changed GetDefaultMimeType to GetMimeType in Laz 0.9.25.
Just rename the method to GetMimeType and it should work.
Thankyou for your answer, I have fixed it, but I have another error:
E:\SVILUPPO\Imaging\Source\ImagingComponents.pas(728,97) Error: Incompatible type for arg no. 4: Got "RECT", expected "PRect"
Source code of ImagingComponents.pas line 728 (red line):
[...cut...]
{$IFDEF COMPONENT_SET_LCL}
// Get raw image from bitmap (mask handle must be 0 or expect violations)
{ If you get complitation error here upgrade to Lazarus 0.9.24+ }
if RawImage_FromBitmap(RawImage, Bitmap.Handle, 0, Classes.Rect(0, 0, Data.Width, Data.Height)) then
begin
LineLazBytes := GetBytesPerLine(Data.Width, RawImage.Description.BitsPerPixel,
RawImage.Description.LineEnd);
[...cut...]
Can you help me on this?
Bye
For this last error I have resolved on this way (see red lines):
[...cut...]
{$IFDEF COMPONENT_SET_LCL}
// Get raw image from bitmap (mask handle must be 0 or expect violations)
{ If you get complitation error here upgrade to Lazarus 0.9.24+ }
aRect := Classes.Rect(0, 0, Data.Width, Data.Height);
if RawImage_FromBitmap(RawImage, Bitmap.Handle, 0, @aRect) then
begin
LineLazBytes := GetBytesPerLine(Data.Width, RawImage.Description.BitsPerPixel,
RawImage.Description.LineEnd);
[...cut...]
with aRect of TRect type, now I compile with success.
There's a better solution?
Bye
Your solution is ok.
You could also call RawImage_FromBitmap with nil as value of PRect parameter, it internally
creates Rect to encompass the whole image.