图像拷贝到剪切板
Function ScreenCapture(ByVal Left As Integer, ByVal Top As Integer, ByVal Right As Integer, ByVal Bottom As Integer) As Boolean
On Error Resume Next
Dim rWidth As Integer, rHeight As Integer
Dim SourceDC As Long, DestDC As Long, bHandle As Long, dHandle As Long, wnd As Long
rWidth = Right - Left
rHeight = Bottom - Top
SourceDC = CreateDC("DISPLAY", 0, 0, 0)
DestDC = CreateCompatibleDC(SourceDC)
bHandle = CreateCompatibleBitmap(SourceDC, rWidth, rHeight)
SelectObject DestDC, bHandle
BitBlt DestDC, 0, 0, rWidth, rHeight, SourceDC, Left, Top, &HCC0020
wnd = Screen.ActiveForm.hwnd
OpenClipboard wnd
EmptyClipboard
ScreenCapture = SetClipboardData(2, bHandle)
CloseClipboard
DeleteDC DestDC
ReleaseDC dHandle, SourceDC
End Function
--------------------------------------
time事件一直运行
Private Sub Timer4_Timer()
ScreenCapture 369 - zleft, 402 - zbottom, 369 + zleft, 402 + zbottom
Image1.Picture = Clipboard.GetData()
Image1.Picture = Nothing
End If
End Sub
以点(369,402)为中心,通过改变zleft和zbottom的大小,来控制放大倍率。
初始设置  zleft=40,zbottom=20
image1.width=400
image1.height=200但是当zleft=zleft*2,zbottom=zbottom*2后,放大的图像中心不在IMAGE1的中心了,越放大,偏离越大,奇怪?