自已研究一下如需要源码发Email给我yczjs@163.com
var
Form1: TForm1;
StoreWidth,StoreHeight: integer;
implementation
{$R *.DFM}
procedure TForm1.ZoomImage (SetWidth: integer; SetHeight: integer);
var Bitmap: TBitmap;
DstRect: TRect;
begin
{ Refresh first -- needed as one maked the image really big first}
Image1.Picture.Graphic.LoadFromFile('dolphin.bmp');
procedure TForm1.SpinButton_WidthDownClick(Sender: TObject);
begin
Edit_Width.Text := IntToStr(StrToInt(Edit_Width.Text) div 2);
if CheckBox_KeepAspectRatio.Checked then
Edit_Height.Text := IntToStr(StrToInt(Edit_Height.Text) div 2);
end;
procedure TForm1.SpinButton_HeightDownClick(Sender: TObject);
begin
Edit_Height.Text := IntToStr(StrToInt(Edit_Height.Text) div 2);
if CheckBox_KeepAspectRatio.Checked then
Edit_Width.Text := IntToStr(StrToInt(Edit_Width.Text) div 2);
end;
procedure TForm1.SpinButton_HeightUpClick(Sender: TObject);
begin
Edit_Height.Text := IntToStr(StrToInt(Edit_Height.Text) * 2);
if CheckBox_KeepAspectRatio.Checked then
Edit_Width.Text := IntToStr(StrToInt(Edit_Width.Text) * 2);
end;
procedure TForm1.SpinButton_WidthUpClick(Sender: TObject);
begin
Edit_Width.Text := IntToStr(StrToInt(Edit_Width.Text) * 2);
if CheckBox_KeepAspectRatio.Checked then
Edit_Height.Text := IntToStr(StrToInt(Edit_Height.Text) * 2);
end;
procedure TForm1.BitBtn_ResetClick(Sender: TObject);
begin
ZoomImage(StoreWidth,StoreHeight);
end;