• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

[Help] Error on compiling demo under Lazarus

Started by mos, 25 August 2008, 19:51:58

Previous topic - Next topic

mos

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

Galfar

Looks like they changed GetDefaultMimeType to GetMimeType in Laz 0.9.25.
Just rename the method to GetMimeType and it should work.

mos

27 August 2008, 09:24:36 #2 Last Edit: 27 August 2008, 09:27:15 by mos
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



mos

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


Galfar

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.

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk