[Originally posted by Robert]
This is an old program for VB3.
'in .bas ********************************
Type pointapi
xcur As Integer
ycur As Integer
End Type
Declare Function StretchBlt% Lib "GDI" (ByVal hDC%, ByVal X%, ByVal Y%, ByVal nWidth%, ByVal nHeight%, ByVal hSrcDC%, ByVal XSrc%, ByVal YSrc%, ByVal nSrcWidth%, ByVal nSrcHeight%, ByVal dwRop&)
Declare Sub GetCursorPos Lib "User" (lpPoint As pointapi)
Declare Function GetDesktopWindow Lib "User" () As Integer
Declare Function GetDC Lib "User" (ByVal hWnd As Integer) As Integer
Declare Function ReleaseDC Lib "User" (ByVal hWnd As Integer, ByVal hDC As Integer) As Integer
Global lppoints As pointapi
'************************************
Put label1, picture1, spin1, GroupPush3D1.
When you press GroupPush3D1 picture in picture1 will be zoomed.
'in form1 **********************************
'+++++++++++++++++++++++++++++++
'put in form1 declaration section
declaration
Dim xold%, yold%
'+++++++++++++++++++++++++++++++
Sub Timer1_Timer ()
If GroupPush3D1.Value = 0 Then Exit Sub
duz = Val(label1.Caption)
GetCursorPos lppoints
If lppoints.xcur <> xold% Or lppoints.ycur <> yols% Then
hwndsrc% = GetDesktopWindow()
hsrcdc% = GetDC(hwndsrc%)
a% = StretchBlt(form1.Picture1.hDC, 0, 0, form1.Picture1.ScaleWidth, form1.Picture1.ScaleHeight, hsrcdc%, lppoints.xcur - duz / 2, lppoints.ycur - duz / 2, duz, duz, &HCC0020)
' a% = StretchBlt(form1.hDC, 0, 0, form1.ScaleWidth, form1.ScaleHeight, hsrcdc%, lppoints.xcur - 50, lppoints.ycur - 50, 100, 100, &HCC0020)
b% = ReleaseDC(hwndsrc%, hsrcdc%)
xold% = lppoints.xcur
yold% = lppoints.ycur
End If
End Sub
Sub Form_Load ()
xold% = 0
yold% = 0
' picture1.visible = False
label1.Caption = 100
End Sub
Sub Spin1_SpinDown ()
label1.Caption = Val(label1.Caption) - 1
label1.Refresh
End Sub
Sub Spin1_SpinUp ()
label1.Caption = Val(label1.Caption) + 1
label1.Refresh
End Sub
Sub GroupPush3D1_Click (Value As Integer)
' Print Value
End Sub
'******************************************