窗体上有一图片,Form.ScaleMode = vbTwips (缇)
请问不用API如何找到图片中某一点的颜色值对应的以Twip(缇)为单位的X、Y的绝对坐标值?
X、Y是窗体的以Twip(缇)为单位的坐标不是屏幕的坐标。
比如;这个颜色点在窗体的 X=1033(Twip)、Y=1041(Twip) 处谢谢老师解答!

解决方案 »

  1.   

    Function Point(X As Single, Y As Single) As Long
        Member of Unknown1._Form
        Returns, as an integer of type Long, the RGB color of the specified point on a Form or PictureBox object.
      

  2.   

    获取PictureBox 任一点的颜色:
    一个PictureBox放置一幅图片,两个TextBox,在图片框内移动属标即可.
    Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    On Error Resume Next
    l = GetPixel(Picture1.hdc, X / 15, Y / 15)
    Text1.BackColor = l
    Text2.Text = "当前颜色:&H" & Hex(l)
    End Sub
      

  3.   

    还是书上说的;
    Dim fColor As Long
    fColor=Form.Point(1033,1041)