Author Topic: [Help] Error on compiling demo under Lazarus  (Read 1699 times)

Offline mos

  • Imaging User
  • *
  • Posts: 23
    • View Profile
[Help] Error on compiling demo under Lazarus
« on: 25 August 2008, 19:51:58 »
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

Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 312
    • View Profile
    • Galfar's Homepage
Re: [Help] Error on compiling demo under Lazarus
« Reply #1 on: 26 August 2008, 22:44:20 »
Looks like they changed GetDefaultMimeType to GetMimeType in Laz 0.9.25.
Just rename the method to GetMimeType and it should work.

Offline mos

  • Imaging User
  • *
  • Posts: 23
    • View Profile
Re: [Help] Error on compiling demo under Lazarus
« Reply #2 on: 27 August 2008, 09:24:36 »
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


« Last Edit: 27 August 2008, 09:27:15 by mos »

Offline mos

  • Imaging User
  • *
  • Posts: 23
    • View Profile
Re: [Help] Error on compiling demo under Lazarus
« Reply #3 on: 27 August 2008, 09:37:30 »
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


Offline Galfar

  • Administrator
  • Imaging User
  • *****
  • Posts: 312
    • View Profile
    • Galfar's Homepage
Re: [Help] Error on compiling demo under Lazarus
« Reply #4 on: 27 August 2008, 11:04:21 »
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.