PictureBox 坐标精度的问题
'注意:这里设置Picture1、Picture2的ScaleWidth和ScaleHeight都是相同的'但取坐标值时,Picture2不能得到保留四位小数的精确值而Picture1可以,可能与鼠标点击处坐标X和Y为单精度浮点型变量有关
'在不改变Picture2.Scale的设置条件下,Picture2如何取到保留四位小数的精确值?
Private Sub Form_Load()
Picture1.Scale (0, 1000)-(1000, 0)
Picture2.Scale (3278426.2345, 657915.4422)-(3279426.2345, 656915.4422)
'这里设置Picture1、Picture2的ScaleWidth和ScaleHeight都是相同的
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Label1.Caption = "X:" & Format(x, "0.0000") & ", Y:" & Format(y, "0.0000")
End Sub
Private Sub Picture2_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Label2.Caption = "X:" & Format(x, "0.0000") & ", Y:" & Format(y, "0.0000")
End Sub