我想实现一个类似于金山词霸屏幕取词的功能,当鼠标移动到图片上面的某个区域时,获取当前鼠标在图片上的位置,然后把这个位置周围的一个小区域在鼠标右下脚
显示出来。
现在存在两个问题:1、如何获取鼠标在图片上的当前位置
                  2、因为截取下来的仍然是一张小图片,想要在鼠标右下脚显示
                     用哪一种控件好呢?
谢谢!

解决方案 »

  1.   

    屏幕放大镜,运行这个程序之后,当光标在屏幕上移动时,光标位置附近的图像会放大显示在程序窗口中。支持以不同的比例放大图像:http://www.applevb.com/sourcecode/screenzoom.zip
      

  2.   

    获取鼠标在图片上的当前位置:
    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Print X, Y
    End Sub我觉得截取下来的那张小图片也可以用PictureBox来显示
      

  3.   

    1.同意小牛的
    2.用bitblt抓图
      

  4.   

    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    MsgBox X, Y
    End Sub
      

  5.   

    Option ExplicitPrivate Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function ReleaseCapture Lib "user32" () As Long
    Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As LongPrivate Sub Form_Load()
        'picture1,picture2
        'picture2为显示小图片用的
        Picture2.Visible = False
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
        If x > 0 And x < Picture1.Width And y > 0 And y < Picture1.Height Then
            Picture2.Left = x + Picture2.Width
            Picture2.Top = y + Picture2.Height + 200
            Picture2.Cls
            BitBlt Picture2.hDC, 0, 0, ScaleX(Picture2.ScaleWidth, vbTwips, vbPixels), _
                ScaleY(Picture2.ScaleHeight, vbTwips, vbPixels), _
                Picture1.hDC, ScaleX(x - 100, vbTwips, vbPixels), ScaleY(y - 100, vbTwips, vbPixels), vbSrcCopy
            Picture2.Visible = True
            SetCapture Picture1.hwnd
        Else
            Picture2.Visible = False
            ReleaseCapture
        End If
    End Sub==============
    试一下吧~`~~~~~~~~~