| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2731 人关注过本帖
标题:[求助]如何在图片控件Picture上画线.
只看楼主 加入收藏
学习VB才2天
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1653
专家分:0
注 册:2006-5-4
收藏
 问题点数:0 回复次数:4 
[求助]如何在图片控件Picture上画线.

如题.....
private sub form1_load()
picture.line=?
好象有些东西不懂..

希望有资料的大大能给予一些简单的VB语句..

搜索更多相关主题的帖子: Picture 控件 
2006-05-11 15:17
VB爱上我
Rank: 6Rank: 6
等 级:贵宾
威 望:25
帖 子:478
专家分:52
注 册:2005-10-14
收藏
得分:0 

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
Picture1.Cls
End If
Picture1.DrawStyle = 4
x1 = X: y1 = Y
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Picture1.Line (x1, y1)-(x2, y2), RGB(255, 0, 0), B
Picture1.Cls
x2 = X: y2 = Y
Picture1.Line (x1, y1)-(x2, y2), RGB(255, 0, 0), B
End If
End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
If you <> 1 Then
x11 = x1: y11 = y1
x22 = X: y22 = Y
Picture1.Line (x11, y11)-(x22, y22), RGB(255, 255, 0), B
you = 1
End If
End Sub


IT618资讯网 提供服务端开发,前端开发,网页特效,热门开源系统研究,软件下载,站长建站,淘宝开店等学习资料.
2006-05-11 16:19
学习VB才2天
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1653
专家分:0
注 册:2006-5-4
收藏
得分:0 
楼上的学问好大
我收集一下...
太感谢楼上了...

[GLOW=255,DeepPink,3]我的免费网盘[/GLOW]
2006-05-13 12:41
VB爱上我
Rank: 6Rank: 6
等 级:贵宾
威 望:25
帖 子:478
专家分:52
注 册:2005-10-14
收藏
得分:0 

Dim x1, x11, x2, x22, y1, y11, y2, y22 As Double
Dim you As Integer

Private Sub Command1_Click()
Picture2.Cls
On Error GoTo a
Picture2.PaintPicture Picture1, x11, y11, x22 - x11, y22 - y11, x11, y11, x22 - x11, y22 - y11, vbSrcCopy
you = 0
Picture1.Cls
Exit Sub
a:
MsgBox "没有选图!"
End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 2 Then
Picture1.Cls
End If
Picture1.DrawStyle = 4
x1 = x: y1 = y
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then
'Picture1.Line (x1, y1)-(x2, y2), RGB(255, 0, 0), B
Picture1.Cls
x2 = x: y2 = y
Picture1.Line (x1, y1)-(x2, y2), RGB(255, 0, 0), B
End If
End Sub

Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
On Error Resume Next
If you <> 1 Then
x11 = x1: y11 = y1
x22 = x: y22 = y
Picture1.Line (x11, y11)-(x22, y22), RGB(255, 255, 0), B
you = 1
End If
End Sub


IT618资讯网 提供服务端开发,前端开发,网页特效,热门开源系统研究,软件下载,站长建站,淘宝开店等学习资料.
2006-05-13 13:24
学习VB才2天
Rank: 5Rank: 5
等 级:贵宾
威 望:16
帖 子:1653
专家分:0
注 册:2006-5-4
收藏
得分:0 
谢谢  不过不大懂   是改进了点东西吗?

[GLOW=255,DeepPink,3]我的免费网盘[/GLOW]
2006-05-15 15:47
快速回复:[求助]如何在图片控件Picture上画线.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.044679 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved