作者CuckooBoy (书仔)
看板Visual_Basic
标题[VB6 ] 回圈问题
时间Mon Dec 24 18:14:04 2007
请教一下,为什麽这样写没办法正常工作?
sorry~~经验不足,看不出怎麽改才对~>"< 卡在这~~~帮忙推一下!
我主要是有n个shape
利用MOUSE的点选及list1~3 选的数字 来决定对应的HByteR HByteG....
MOUSE没选任何shape时,这些HByteR HByteG.... 都为初值
如 : text1=0000000000000000000000000.....
当mouse点选shape中的某个时..... text1只改变对应的0,但没选的都还是0
有选的那几个会改而已.....
我这样写离功能会差很远吗? 怎麽写会比较好呢?
Dim User_Flag As Boolean
Dim DataRGB As Long
Dim DataR(0) As String
Dim DataG(127) As String
Dim DataB(127) As String
Dim HByteR(127) As String
Dim LByteR(127) As String
Dim HByteG(127) As String
Dim LByteG(127) As String
Dim HByteB(127) As String
Dim LByteB(127) As String
Private Sub Form_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
If User_Flag = True Then
For i = 0 To 2
If (X > Shape1(i).Left And X < Shape1(i).Left + Shape1(i).Height) And
(Y > Shape1(i).Top And Y < Shape1(i).Top + Shape1(i).Height) Then
Shape1(i).BackColor = RGB(List1.List(List1.TopIndex),
List2.List(List2.TopIndex),
List3.List(List3.TopIndex))
HByteR(i) = Left(Hex(List1.List(List1.TopIndex)), 2)
LByteR(i) = Right(Hex(List1.List(List1.TopIndex)), 2)
HByteG(i) = Left(Hex(List2.List(List2.TopIndex)), 2)
LByteG(i) = Right(Hex(List2.List(List2.TopIndex)), 2)
HByteB(i) = Left(Hex(List3.List(List3.TopIndex)), 2)
LByteB(i) = Right(Hex(List3.List(List3.TopIndex)), 2)
End If
Next i
Text4.Text = Chr("&H" & HByteR(0)) & Chr("&H" & LByteR(0)) &
Chr("&H" & HByteG(0)) & Chr("&H" & LByteG(0)) &
Chr("&H" & HByteB(0)) & Chr("&H" & LByteB(0)) &
Chr("&H" & HByteR(1)) & Chr("&H" & LByteR(1)) &
Chr("&H" & HByteG(1)) & Chr("&H" & LByteG(1)) &
Chr("&H" & HByteB(1)) & Chr("&H" & LByteB(1)) &
Chr("&H" & HByteR(2)) & Chr("&H" & LByteR(2)) &
Chr("&H" & HByteG(2)) & Chr("&H" & LByteG(2)) &
Chr("&H" & HByteB(2)) & Chr("&H" & LByteB(2))
End If
End Sub
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.195.12.186
※ 编辑: CuckooBoy 来自: 123.195.12.186 (12/24 18:17)
1F:推 DRAGONLL:要不要考虑三条 HScroll的拉动来控制输出的RGB图 12/24 19:15
2F:→ DRAGONLL:会简单很多 12/24 19:16
3F:→ CuckooBoy:MAX没办法到65536,所以才用List 12/24 20:08
4F:→ CuckooBoy:现在没办法改变text1中某个位元的资料 12/24 20:16
5F:→ CuckooBoy:类似预设0的暂存器,依滑鼠点哪一个的位置去改变相对位置 12/24 20:17
6F:→ CuckooBoy:的位元,最後再一起将资料送出去,送出去前都可以改变 12/24 20:19
※ 编辑: CuckooBoy 来自: 123.195.12.186 (12/24 20:23)