保存的时候保存线条的起点坐标和终点坐标即可
读取的时候读取每个线条的起点坐标和终点坐标,然后在画:
picture1.line 起点坐标-终点坐标
读取的时候读取每个线条的起点坐标和终点坐标,然后在画:
picture1.line 起点坐标-终点坐标
解决方案 »
- VSflexGrid单元格类似Text.Tag的属性是哪个呢?我想把编码显示到Tag里,文本显示到TextMatrix里。
- [请教]如何使程序开机自动运行并隐藏后台???!!!
- 这个动态“分组统计报表”错误在哪里?请高手指点。谢谢
- 困惑已久的问题???????
- 一個菜鳥問題請大家幫忙
- 怎样计算上个月的某一天
- 请高手帮忙
- 水晶报表的宽度?在设计时,有一个字段很长,所以要把报表的宽度变大。可是怎莫调呢?帮帮忙。
- 二个问题
- ##########兄弟们进来看一下!!!##############
- 怎么得到服务器的当前时间?
- 有谁对spooling技术或者共享打印机技术比较了解的,请指点小弟一下!100分在线等待!!!
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As LongDim BegX As Integer, BegY, EndX, EndY
Dim LDown As BooleanPrivate Sub Form_Load()
Picture1.Move 0, 0, Me.Width, Me.Height
Picture1.ZOrder 0
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
LDown = False
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then
BegX = x
BegY = y
LDown = True
End If
End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If LDown = True Then
Picture1.ZOrder 0
Picture1.Line (EndX, EndY)-(BegX, BegY), Picture1.BackColor
Picture1.Line (BegX, BegY)-(x, y)
EndX = x
EndY = y
Picture2.Width = Abs(BegX - EndX)
Picture2.Height = Abs(BegY - EndY)
End If
End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
LDown = False
Picture2.Cls
'''这里只写了有角度的线条截取,如果水平或垂直线条可以直接在PICTURE2上画,不用BITBLT
If BegX < EndX And BegY < EndY Then
BitBlt Picture2.hDC, 0, 0, Picture2.Width, Picture2.Height, Picture1.hDC, BegX / 15, BegY / 15, vbSrcCopy
ElseIf BegX > EndX And BegY < EndY Then
BitBlt Picture2.hDC, 0, 0, Picture2.Width, Picture2.Height, Picture1.hDC, EndX / 15, BegY / 15, vbSrcCopy
ElseIf BegX < EndX And BegY > EndY Then
BitBlt Picture2.hDC, 0, 0, Picture2.Width, Picture2.Height, Picture1.hDC, BegX / 15, EndY / 15, vbSrcCopy
ElseIf BegX > EndX And BegY > EndY Then
BitBlt Picture2.hDC, 0, 0, Picture2.Width, Picture2.Height, Picture1.hDC, EndX / 15, EndY / 15, vbSrcCopy
End If
Picture1.Cls
Picture2.ZOrder 0
Picture2.Move 0, 0
SavePicture Picture2.Image, "c:\temp.bmp"
MsgBox "Save TO “C:\temp.bmp”OK !"End SubPrivate Sub Picture2_Click()
Picture2.ClsEnd Sub
我真笨! 舍近求远了
保存为EMF是最好的选择在MSDN去检索“Metafile”,很详细的
请问鼠标点的坐标值为什么要除以15呢?
:
你说的方法我很早就想到了,但是由于为止客户需要画多少LINE,采用PICBOX控件数组占用资源太大,此方法我认为不可取