Private Declare Function Rectangle& Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long)
Private Declare Function SetWorldTransform& Lib "gdi32" (ByVal hdc As Long, lpXform As XFORM)
Private Declare Function ModifyWorldTransform& Lib "gdi32" (ByVal hdc As Long, lpXform As XFORM, ByVal iMode As Long)
Private Declare Function GetWorldTransform& Lib "gdi32" (ByVal hdc As Long, lpXform As XFORM)
Private Declare Function SetGraphicsMode& Lib "gdi32" (ByVal hdc As Long, ByVal iMode As Long)
Private Declare Function SetMapMode& Lib "gdi32" (ByVal hdc As Long, ByVal nMapMode As Long)
Private Declare Function GetViewportExtEx& Lib "gdi32" (ByVal hdc As Long, lpSize As SIZE)
Private Declare Function GetViewportOrgEx& Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI)
Private Declare Function SetViewportExtEx& Lib "gdi32" (ByVal hdc As Long, ByVal nX As Long, ByVal nY As Long, lpSize As SIZE)
Private Declare Function ScaleViewportExtEx& Lib "gdi32" (ByVal hdc As Long, ByVal nXnum As Long, ByVal nXdenom As Long, ByVal nYnum As Long, ByVal nYdenom As Long, lpSize As SIZE)
Private Declare Function SetViewportOrgEx& Lib "gdi32" (ByVal hdc As Long, ByVal nX As Long, ByVal nY As Long, lpPoint As POINTAPI)
Private Declare Function Ellipse& Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long)
Private Declare Function SetWindowExtEx& Lib "gdi32" (ByVal hdc As Long, ByVal nX As Long, ByVal nY As Long, lpSize As SIZE)
Private Declare Function SetWindowOrgEx& Lib "gdi32" (ByVal hdc As Long, ByVal nX As Long, ByVal nY As Long, lpPoint As POINTAPI)
Private Declare Function GetWindowExtEx& Lib "gdi32" (ByVal hdc As Long, lpSize As SIZE)
Private Declare Function GetWindowOrgEx& Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI)
Private Declare Function CreatePen& Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long)
Private Declare Function SelectObject& Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long)
Private Declare Function DeleteObject& Lib "gdi32" (ByVal hObject As Long)
Private Declare Function SaveDC& Lib "gdi32" (ByVal hdc As Long)
Private Declare Function RestoreDC& Lib "gdi32" (ByVal hdc As Long, ByVal nSavedDC As Long)
Private Declare Function SetROP2& Lib "gdi32" (ByVal hdc As Long, ByVal nDrawMode As Long)
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)
Private 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)
Const GM_ADVANCED& = 2
Const MWT_IDENTITY& = 1
Const MM_ANISOTROPIC& = 8
Const R2_COPYPEN& = 13
Const SRCCOPY& = &HCC0020
Private Sub Check1_Click()
Timer1.Enabled = Check1.Value
End Sub
Private Sub cmdSet_Click()
myXform.eDy = CSng(txteDy.Text)
myXform.eDx = CSng(txteDx.Text)
myXform.eM11 = CSng(txtEM11.Text)
myXform.eM12 = CSng(txtEM12.Text)
myXform.eM21 = CSng(txtEM21.Text)
myXform.eM22 = CSng(txtEM22.Text)
Me.Refresh
End Sub
#End If 'WIN32
Private Sub Form_Paint()
Dim savedDC&
'Save the DC
savedDC& = SaveDC&(Me.hdc)
'Make sure we can rotate
dummy& = SetMapMode&(Me.hdc, MM_ANISOTROPIC)
dummy& = SetGraphicsMode&(Me.hdc, GM_ADVANCED)
PI = 3.14159265358979
dummy& = SetWorldTransform&(Me.hdc, myXform)
'Set the text boxes
txtEM11 = CStr(myXform.eM11)
txtEM12 = CStr(myXform.eM12)
txtEM21 = CStr(myXform.eM21)
txtEM22 = CStr(myXform.eM22)
txteDx = CStr(myXform.eDx)
txteDy = CStr(myXform.eDy)
UpdateScrollBars myXform
'Set the logical window and the viewport to reasonable values