请问为什么图像质量会降低呢?
请注意:生成的类没释放。)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,jpeg, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
PaintBox1: TPaintBox;
procedure FormCreate(Sender: TObject);
procedure PaintBox1Paint(Sender: TObject);
private
tempImage:TPicture;
temp:TJpegImage;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
tempImage:=TPicture.Create();
temp:=TJpegImage.Create();
temp.CompressionQuality:=100;
temp.Smoothing:=true;
end;
procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
temp.LoadFromFile('d:\connect.jpg');
tempImage.Bitmap.Assign(temp);
BitBlt(PaintBox1.canvas.handle,1,1,300,400,tempImage.Bitmap.Canvas.Handle,1,1,MERGECOPY );
end;
end.