| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 542 人关注过本帖
标题:程序可以运行但是不出图像,请问哪里不对?
只看楼主 加入收藏
zmwlmt
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-10-21
收藏
 问题点数:0 回复次数:2 
程序可以运行但是不出图像,请问哪里不对?
Dim x1, y1, x2, y2, left_c As Integer
Dim tool1, tool2, tool3, tool4 As Integer


Private Sub Form_Load()
left_c = 0
End Sub

Private Sub Command1_Click()
tool1 = 1
End Sub

Private Sub Command2_Click()
tool2 = 1
End Sub

Private Sub Command3_Click()
tool3 = 1
Picture1.ForeColor = QBColor(10)
End Sub

Private Sub Command4_Click()
tool4 = 1
Picture1.ForeColor = QBColor(9)
End Sub

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If too1 = 1 And tool2 = 0 And tool3 = 1 And too4 = 0 Then
If Button = 0 Then
left_c = 0

Else
If left_c = 0 Then

x1 = X
y1 = Y
left_c = 1
Else
x2 = X
y2 = Y
Picture1.Line (x1, y1)-(x2, y2)
x1 = x2
y1 = y2

End If
End If
'-----------------------------------------------------
ElseIf too1 = 1 And tool2 = 0 And tool3 = 0 And too4 = 1 Then
If Button = 0 Then
left_c = 0

Else
If left_c = 0 Then

x1 = X
y1 = Y
left_c = 1
Else
x2 = X
y2 = Y
Picture1.Line (x1, y1)-(x2, y2)
x1 = x2
y1 = y2

End If
End If
'-----------------------------------------------------
ElseIf too1 = 0 And tool2 = 1 And tool3 = 1 And too4 = 0 Then
If left_c = 0 Then

x1 = X
y1 = Y
left_c = 1
Else
x2 = X
y2 = Y
Picture1.Line (x1, y1)-(x2, y2)
left_c = 0
End If
'-----------------------------------------------------
ElseIf too1 = 0 And tool2 = 1 And tool3 = 0 And too4 = 1 Then
If left_c = 0 Then

x1 = X
y1 = Y
left_c = 1
Else
x2 = X
y2 = Y
Picture1.Line (x1, y1)-(x2, y2)
left_c = 0
End If
End If

End Sub
搜索更多相关主题的帖子: 图像 运行 
2008-10-21 12:43
zmwlmt
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-10-21
收藏
得分:0 
两种颜色选择成功,但是两种画线方式只有一种能实现,请问我该怎么修改?
2008-10-21 12:45
风吹过b
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:364
帖 子:4943
专家分:30067
注 册:2008-10-15
收藏
得分:0 
没看懂你这个题目要干什么.

画一种线是画出来了.才4个按键,为什么要那么多的变量来确定状态?
如果是互斥的条件,可以用一个变量来标志.

授人于鱼,不如授人于渔
早已停用QQ了
2008-10-21 14:03
快速回复:程序可以运行但是不出图像,请问哪里不对?
数据加载中...
 
   



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

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