Delphi绘图特效

来源:百度知道 编辑:UC知道 时间:2024/06/06 11:22:27
procedure TForm1.FormActivate(Sender: TObject);
begin
bitmap:=tbitmap.create;
bitmap.loadfromfile('bg.bmp');
Form1.Canvas.Draw(0,0,Bitmap);
end;

这里的Form1.Canvas.Draw(0,0,Bitmap);为什么用了两个0,0里面的三个数据是分别代表什么意思(⊙o⊙)?

Call Draw to draw a graphic on the canvas. Draw calls the Draw method of the graphic. The image is rendered into a rectangle determined by the size of the graphic, with the upper left corner at the point (X, Y).

Graphics can be bitmaps, icons, or metafiles. If the graphic is a TBitmap object, the bitmap is rendered using the value of CopyMode.
x.y 就是图片的在上角的坐标 在你的例子里是x=0 y=0