核心提示:procedure TForm1.Button1Click(Sender: TObject);varbmp1,bmp2:TBitmap;SrcR,DesR:TRect;x,y:Integer;begi...
procedure TForm1.Button1Click(Sender: TObject);
var
bmp1,bmp2:TBitmap;
SrcR,DesR:TRect;
x,y:Integer;
begin
bmp1:=TBitmap.Create;
bmp2:=Tbitmap.Create;
Try
bmp1.LoadFromFile('e:\test.bmp');
x:=bmp1.Width;
y:=bmp1.Height;
SrcR:=Rect(0,0,x,y);
DesR:=Rect(x,0,0,y);
bmp2.Width:=x;
bmp2.Height:=y;
bmp2.Canvas.CopyRect(DesR,bmp1.Canvas,SrcR);
canvas.Draw(0,0,bmp2); //将反转后的图像画在窗体上
Finally
bmp1.Free;
bmp2.Free;
end;
end;