VB编写的手机抓图程序

时间:2010-01-28 13:49:45  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:nbsp;    邮箱:freeforever@sohu.com                       ='=                           ...
  正文:

'===============================================
'=                                   邮箱:freeforever@sohu.com                       =
'=                                             useforprogram@126.com                  =
'=       此程序是为我的手机而写,用来在屏幕上抓图(128X128,我手机图片的大小)        =
'=                                                                        2005-8-5    =
'===============================================
'2005-07-21更新:与AcdSee3.1配合使用抓图时使其变慢,原因是取得设备的DC后没有释放
Option Explicit
'坐标类
Private Type POINTAPI
    X As Long
    Y As Long
End Type
'Image的拷贝常量,用在Bitblt函数中
Private Const SRCCOPY = &HCC0020
'CombineRgn函数执行XOR操作的常数
Private Const RGN_XOR = 3
'文件的序号(全局变量)
Dim intF_Num As Integer
'移动窗体时记录下鼠标坐标(全局变量)
Dim xx As Single, yy As Single
'标识窗体是否可以移动(全局变量)
Dim blnMove As Boolean
'获取指定窗口的设备场景,HWnd为0时即屏幕的DC,
'在下面Bitblt函数中到用到屏幕的DC
Private Declare Function GetDC Lib "user32" ( _
    ByVal hwnd As Long) As Long
'保存图片用到的关键函数,第一个参数用Picture Box的句柄,
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 Long
'创建一个由点X1,Y1和X2,Y2描述的矩形区域
Private Declare Function CreateRectRgn Lib "gdi32" ( _
    ByVal X1 As Long, _
    ByVal Y1 As Long, _
    ByVal X2 As Long, _
    ByVal Y2 As Long) As Long
'将两个区域组合为一个新区域
Private Declare Function CombineRgn Lib "gdi32" ( _
    ByVal hDestRgn As Long, _
    ByVal hSrcRgn1 As Long, _
    ByVal hSrcRgn2 As Long, _
    ByVal nCombineMode As Long) As Long
'改变窗口的区域,中空的窗口就是用这个函数和上面两个函数组合生成的
Private Declare Function SetWindowRgn Lib "user32" ( _
    ByVal hwnd As Long, _
    ByVal hRgn As Long, _
    ByVal bRedraw As Long) As Long
'将用区坐标转换成屏幕坐标,用它来知道中空框的具体位置
Private Declare Function ClientToScreen Lib "user32" ( _

"VB编写的手机抓图程序"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Language/VB/12561.html


关键字:

关于《VB编写的手机抓图程序》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td