procedure TForm1.FormMouseDown(Sender: TObject
Button: TMouseButton;
Shift: TShiftState
X, Y: Integer);
begin
FPoint.X := X;
FPoint.Y := Y;
self.Canvas.TextOut(20,10,'X:'+IntToStr(FPoint.X)+';Y:'+IntToStr(FPoint.Y));
CreateImage;
end;
procedure TForm1.CreateImage;
begin
if Assigned(FImage) then
FreeAndNil(FImage);
FImage := TImage.Create(nil);
FImage.Top := FPoint.Y;
FImage.Left := FPoint.X;
FImage.Parent := self;
FImage.Width := 64;
FImage.Height := 64;
FImage.Picture.LoadFromFile('G:/Icon/图标/winxp/application/application/dd.ico');
end;
楼主,这种每次都动态创建的方法很消耗资源,使用起来要注意阿