Using MagickRotateImage with Lazarus (Pascal)
Posted: 2015-10-19T09:31:59-07:00
Hi, I need some help getting started with the Lazarus APIs. I can display a png image (with the code below) but I can't find a way to rotate the image using: MagickRotateImage(Wand,Background,degrees). Putting it in the code below has no effect. Thanks for any help.
//-----------------------------------Displays the Image in a Lazarus Window-------------------------------------
procedure OpenBitMap;
var
Bitmap: TBitmap;
wand: PMagickWand;
status: MagickBooleanType;
begin
Bitmap := TBitmap.Create;
wand := NewMagickWand;
status := MagickReadImage(wand, PChar(UTF8ToSys('c:\temp\testimage.png'));
LoadMagickBitmapWand(wand, Bitmap);
Form1.Canvas.Brush.Bitmap := Bitmap;
Form1.Canvas.FillRect(Rect(0,0,Bitmap.Width,Bitmap.Height));
end;
//--------------------------------------------------------------------------------------------------
//-----------------------------------Displays the Image in a Lazarus Window-------------------------------------
procedure OpenBitMap;
var
Bitmap: TBitmap;
wand: PMagickWand;
status: MagickBooleanType;
begin
Bitmap := TBitmap.Create;
wand := NewMagickWand;
status := MagickReadImage(wand, PChar(UTF8ToSys('c:\temp\testimage.png'));
LoadMagickBitmapWand(wand, Bitmap);
Form1.Canvas.Brush.Bitmap := Bitmap;
Form1.Canvas.FillRect(Rect(0,0,Bitmap.Width,Bitmap.Height));
end;
//--------------------------------------------------------------------------------------------------