vb6.0中,请问如何将一个以上的picturebox中画的曲线保存在一张图片上?

2024-12-27 08:37:58
推荐回答(2个)
回答1:

Dim oldx As Single
Dim oldy As Single
Dim bg As Boolean

Private Sub Form_Load()
Picture1.AutoRedraw = True
bg = True
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then '当鼠标左建按下时发生
If bg = False Then
Picture1.Line (oldx, oldy)-(X, Y)
End If
oldx = X
oldy = Y
bg = False
End If
End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
bg = True
End Sub
Private Sub Command1_Click()
Picture1.AutoRedraw = False
Set Picture1.Picture = Picture1.Image
SavePicture Picture1.Picture, App.Path & "\123.bmp"
End Sub

回答2:

可以做个隐藏画面。将你需要保存的Picture画像重绘到该画面上。然后Print该画面。利用API截取图片或者另存。