[Delphi (Object Pascal)] Delphi通过Com+调用ImageMagick的范例代码 →→→→→进入此内容的聊天室

来自 , 2020-04-12, 写在 Delphi (Object Pascal), 查看 170 次.
URL http://www.code666.cn/view/54eea697
  1.  
  2. // uses section for GUI application:
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, ImageMagickObject_TLB, activeX, StdCtrls;
  6.  
  7.  
  8.  
  9. // Example procedure using COM object
  10. procedure Test;
  11. var
  12.   v : Variant;
  13.  im : TMagickImage;
  14. begin
  15.  
  16.   im := TMagickImage.Create(nil);
  17.   try
  18.  
  19.    v := VarArrayCreate([0, 3], varVariant);
  20.    v[0] := 'logo:';
  21.  
  22.  // rotation example
  23.  //  v[1] := '-rotate';
  24.  //  v[2] := '10';
  25.  
  26.  
  27.  // crop example - crop to 94x103 starting at 30, 25
  28.  //  v[1] := '-crop';
  29.  //  v[2] := '94x103+30+25';
  30.  
  31.  
  32.  // resize example - set width = 150 (will keep aspect ratio)
  33.     v[1] := '-resize';
  34.     v[2] := '150';
  35.  
  36.  // output filename
  37.    v[3] := 'logo2.jpg';
  38.  
  39.  // execution
  40.    im.Convert(PSafeArray(TVarData(v).VArray));
  41.  
  42.   finally
  43.    im.Free;
  44.   end;
  45.  
  46. end;
  47.  
  48. //delphi/8992

回复 "Delphi通过Com+调用ImageMagick的范例代码"

这儿你可以回复上面这条便签

captcha