通过OpenPictureDialog打开一副图片后,怎么实现鼠标移动到图片上的某一点读出这一点的X,Y坐标值?

解决方案 »

  1.   

    OnMouseMove事件中读X,Y
      x = x+form1.left
      y = y+from1.top
      

  2.   

    TPoint tPoint=Point(X,Y)是客户区坐标
    CilentToScreen(tPoint);转化为屏幕坐标
      

  3.   

    //以下是我现编的示例!你可以看看……
    //虽然简单,但是还是请你给点参与分吧!!!呵呵
    procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
      Y: Integer);
    var
      Pos_x,Pos_y:integer;
    begin
      Pos_X:=x;//鼠标的X坐标
      Pos_y:=y;//鼠标的Y坐标
      Label1.Caption:=inttostr(Pos_x)+'----'+inttostr(Pos_y);
    end;