Private Declare Function ReleaseCapture Lib "User32" () As Long
Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "User32" (ByVal hWnd As Long, ByVal crey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Const GWL_EXSTYLE As Long = (-20)
Private Const WS_EX_LAYERED As Long = &H80000
Private Const WS_EX_TRANSPARENT As Long = &H20&
Private Const LWA_ALPHA As Long = &H2&
Private Const LWA_COLORKEY As Integer = &H1
Private Key_Press As Byte
Private Incr As Byte
Private Const Rad As Currency = 1.74532925199433E-02
Private Const Pi As Currency = 3.14159265358979
Private Const WM_MOUSEWHEEL As Long = &H20A
Private Const WM_WINDOWPOSCHANGED As Long = &H47
Private sc As cSuperClass
Implements iSuperClass
Private Declare Function rotatedc Lib "Rotate.Lib" Alias "rotatedc@60" (ByVal aHDC As Long, ByVal Angle As Single, ByVal x As Long, ByVal Y As Long, ByVal W As Long, ByVal H As Long, ByVal PicDC As Long, Optional ByVal SrcX As Long = 0, Optional ByVal SrcY As Long = 0, Optional ByVal pScale As Single = 1, Optional ByVal TraspColor As Long = -1, Optional ByVal Alpha As Single = 1, Optional ByVal Hue As Single = 0, Optional ByVal Sat As Single = 0, Optional ByVal Lum As Single = 0) As Long
Private T As Long
Private Sub Form_DblClick()
On Error GoTo erro
CommonDialog1.CancelError = True
CommonDialog1.Filter = "All Supported Images|*.bmp;*.dib;*.gif;*.jpg;*.wmf;*.emf;*.ico;*.cur|Bitmaps|*.bmp;*.dib|JPEG Images|*.jpg|Metafiles|*.wmf;*.emf|Icons|*.ico;*.cur"
CommonDialog1.ShowOpen
If CommonDialog1.FileName <> "" Then
S.Picture = LoadPicture(CommonDialog1.FileName)
Draw
End If
exit_sub:
Exit Sub
erro:
Resume exit_sub
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Key_Press = KeyCode
Select Case KeyCode
Case 112
Incr = 1
Case 113
Incr = 5
Case 114
Incr = 10
Case 115
Text1.Visible = Text1.Visible Xor -1
Case 116
Dim x As New Form1
x.Show
Case 27
End
End Select
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Key_Press = 0
End Sub
Private Sub Form_Load()
Dim Ret As Long
Dim sSave As String
Dim x() As Byte
Form2.Show
Incr = 10
sSave = Space(255)
Ret = GetSystemDirectory(sSave, 255)
sSave = Left$(sSave, Ret)
If Dir(sSave & "\Rotate.Lib") = "" Then
x = LoadResData(101, "CUSTOM")
Open sSave & "\Rotate.Lib" For Binary As 1
Put #1, 1, x
Close 1
End If
Ret = GetWindowLong(Me.hWnd, GWL_EXSTYLE)
Ret = Ret Or WS_EX_LAYERED
SetWindowLong Me.hWnd, GWL_EXSTYLE, Ret
SetLayeredWindowAttributes Me.hWnd, 0, 255, LWA_COLORKEY Or LWA_ALPHA