vb如何对网页进行截屏
vb对一个网页如新浪这样的进行截屏,如何做?
[解决办法]
http://www.ej38.com
[解决办法]
真不懂怎么弄的,不过,好像有个控件可以直接 SaveAsBitmap .
[解决办法]
以前有写过一段代码,但不是保存网页,不知能不能用
Public Declare Function StretchBlt Lib "gdi32" (ByVal hdc 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 nSrcWidth As Long, _
ByVal nSrcHeight As Long, _
ByVal dwRop As Long) As Long
Public Const SRCCOPY = &HCC0020
'Public Const SRCCOPY = &H8800C6
'-----------------------------------------------------
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) '程序延迟
Public Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Public Declare Function SetPixel Lib "gdi32" Alias "SetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Public Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As Long) As Long
Sub PrtSc(ByVal x As Long, ByVal y As Long, ByVal w As Long, ByVal h As Long)
Dim hdc As Long, x1 As Long, y1 As Long
hdc = GetDC(0) 'hwnd为0时DC为屏幕DC
For x1 = x To x + w '遍历每一列
For y1 = y To y + h '遍历每一行
SetPixel GetDC(Form1.hwnd), x1, y1, GetPixel(hdc, x1, y1)
Next y1
Next x1
End Sub