不需要api吧!用mouseover试试!

解决方案 »

  1.   

    请到下面的帖子参与讨论,谢谢!
    http://www.csdn.net/expert/topic/667/667096.xml?temp=.3140528
      

  2.   

    用ActiveBar或下载一些IE按钮风格的控件。
      

  3.   


    在www.dapha.net/bbs上,正在开专栏    在初学者板块!
      

  4.   

    不用这么麻烦,用Mousemove事件就行了。
      

  5.   

    鼠标移到控件上时,控件会收到MouseMove事件,鼠标离开控件时,控件就收不到MouseMove事件了。所以MouseMove无法解决“离开时变回”的问题。应用SetCapture在控件收到MouseMove事件时为鼠标戴上追踪器,并判断鼠标是否离开控件,当鼠标离开控件后,用ReleaseCapture解下鼠标的追踪器。Private Declare Function SetCapture Lib "user32" Alias "SetCapture" (ByVal hwnd As Long) As Long
    Private Declare Function ReleaseCapture Lib "user32" Alias "ReleaseCapture" () As Long
      

  6.   

    可以用GetPixel和SetPixel实现,但是有问题如下Private Type Color
        R As Long
        G As Long
        B As Long
    End Typedim temp as Color
    temp = GetPixel(Picture1.hdc, XX, YY)提示类型不匹配
      

  7.   

    dim temp as long
    temp = GetPixel(Picture1.hdc, XX, YY)GetPixel返回long
      

  8.   

    我需要分解出特定像素的RGB值,有办法吗?
    如果GetPixel返回long的话,就得不到RGB值了
      

  9.   

    R = temp  Mod 256
        G = temp \ 256 Mod 256
        B = temp \ 65536
      

  10.   

    505(五五)我用下面的代码得不到想要的效果,即在Picture2中得到一份Picture1的拷贝Private Sub Command1_Click()
        Dim temp As Long, R As Long, G As Long, B As Long, i As Integer, j As Integer
        For i = 0 To Picture1.Top
          For j = 0 To Picture1.Left
       temp = GetPixel(Picture1.hdc, Picture1.Left + i, Picture1.Top + j)
       ' R = temp Mod 256 And &HFF
       ' G = temp \ 256 Mod 256 And &HFF
       ' B = temp \ 65536 And &HFF
       SetPixel Picture2.hdc, Picture2.Left + i, Picture2.Top, temp
      Next j
      Next i
    End Sub
      

  11.   

    Picture1.ScaleMode = 3
    Picture2.ScaleMode = 3
    Private Sub Command1_Click()
        Dim temp As Long, R As Long, G As Long, B As Long, i As Integer, j As Integer
        For i = 0 To Picture1.Width-1
          For j = 0 To Picture1.Height-1
       temp = GetPixel(Picture1.hDC, i, j)
       ' R = temp Mod 256 And &HFF
       ' G = temp \ 256 Mod 256 And &HFF
       ' B = temp \ 65536 And &HFF
       SetPixel Picture2.hDC, i, j, temp
      Next j
      Next i
    End Sub