截取屏幕图像
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long Private Sub Form_Load()
Dim hBitmap As Integer
Me.AutoRedraw = True
hBitmap = CreateCompatibleBitmap(Me.hdc, 0, 0)
SelectObject Me.hdc, hBitmap
End Sub
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long Private Sub Form_Load()
Dim hBitmap As Integer
Me.AutoRedraw = True
hBitmap = CreateCompatibleBitmap(Me.hdc, 0, 0)
SelectObject Me.hdc, hBitmap
End Sub
解决方案 »
- 窗体LOAD时 根据datagridview中某列的字符,确定行的背景色
- 利用VB实现递归调用
- 在VB中通过Microsoft.Jet.OLEDB访问SQL时应给SQL用户什么权限?
- 用dataGrid控件时,总出现这个错误,郁闷死了
- 请问VB怎样发送全局键盘消息
- 如何在VB6中修改Access报表上的固定文本
- 请教高手问题,怎么判断文件的完整性?
- 有vb项目的源代码,但不知道使用的控件名,请大家帮我看一下使用的是什么控件阿。急!!
- 提问
- 散分 我加薪了 呵呵 加了1000块---〉希望大家都加薪
- 请问用什么才能打开TBasic(不是Visual Basic)的源程序啊?
- 如何实现俩个客户端之间点到点的直接文件传送?
要的话,跟我联系
[email protected]
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
Private Const SRCCOPY = &HCC0020Private Sub Command1_Click()
Form1.Hide
DoEvents
BitBlt Form1.hDC, 0, 0, Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, GetWindowDC(0), 0, 0, SRCCOPY
SavePicture Form1.Image, "c:\abc.bmp"
Form1.Cls
Form1.Show
End SubPrivate Sub Command2_Click()
Unload Me
End Sub