Option Explicit Dim x0 As Single, y0 As SinglePrivate Sub Form_Load() Picture1.AutoRedraw = True Picture1.BackColor = vbWhite Picture1.DrawMode = vbNotXorPen Picture1.DrawWidth = 5 x0 = -1 End SubPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If x0 <> -1 Then Picture1.Line (x0, y0)-(x0, y0) Picture1.Line (X, Y)-(X, Y) x0 = X y0 = Y End Sub
kmzs(.:RNPA:.山水岿濛) , 怎样取的原来点的像素?已知原来点的坐标。
给你一段代码参考另:你的分太少了,让大伙怎么分啊Option ExplicitPrivate Sub Command1_Click() Form1.Line (100, 100)-(1000, 1000) End SubPrivate Sub Command2_Click() Me.Cls End SubPrivate Sub Form_Load() Me.AutoRedraw = True Me.Circle (1000, 1000), 500 Set Me.Picture = Me.Image End Sub
Dim x0 As Single, y0 As SinglePrivate Sub Form_Load()
Picture1.AutoRedraw = True
Picture1.BackColor = vbWhite
Picture1.DrawMode = vbNotXorPen
Picture1.DrawWidth = 5
x0 = -1
End SubPrivate Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If x0 <> -1 Then Picture1.Line (x0, y0)-(x0, y0)
Picture1.Line (X, Y)-(X, Y)
x0 = X
y0 = Y
End Sub
Form1.Line (100, 100)-(1000, 1000)
End SubPrivate Sub Command2_Click()
Me.Cls
End SubPrivate Sub Form_Load()
Me.AutoRedraw = True
Me.Circle (1000, 1000), 500
Set Me.Picture = Me.Image
End Sub