procedure TForm1.Map1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
 StartX:=X;
 StartY:=Y;
 if end_flag=0 then
 Canvas.lineTo(X,Y);
 button3.Caption:='X='+inttostr(X)+',Y='+inttostr(Y);
end;这是坐标显示的代码,如果手工限定X和Y的范围

解决方案 »

  1.   

    GetCurpos来获取屏幕坐标的焦点然后再换算成你那的坐标
      

  2.   

    不明白,具体怎么用的?我要显示Map1MouseMove上的坐标
      

  3.   

    var CurPoint: TPoint;
    GetCursorPos(CurPoint); 
    -----------------
    CurPoint.X   //x 坐標 
    CurPoint.Y   //y 坐標
      

  4.   

    现在的X,Y都是从0开始一直到map1的高度和宽度,左上是(0,0)右下是(max高度,max宽度)
    我要让他从左上(5,6)到右下(10,12)这个范围