编译器是Delphi 2010
程序错误很多啊
哪个帮忙改下
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses Wincode;
procedure TForm1.Button1Click(Sender: TObject);
var
WicImg: TWICImage;
Factory: IWICImagingFactory;
Scaler: IWICBitmapScaler; {图像比例变换接口}
begin
WicImg := TWICImage.Create;
WicImg.LoadFromFile('c:\temp\test.jpg');
Factory.CreateBitmapScaler(Scaler);
Scaler.Initialize(WicImg.Handle,
WicImg.Width div 2, WicImg.Height div 3,
WICBitmapInterpolationModeFant);
WicImg.Handle := IWICBitmap(Scaler);
Canvas.Draw(0, 0, WicImg);
Scaler := nil;
Factory := nil;
WicImg.Free;
end;
end.