Option Explicit
'==========================================================================
'功能:任意旋转图片
'用法:
'Option Explicit
'Private Sub Form_Load()
' Picture1.ScaleMode = 3
' Picture1.AutoRedraw = True
' Picture1.AutoSize = True
' Picture2.ScaleMode = 3
' Picture2.AutoRedraw = True
'End Sub
'Private Sub Command1_Click()
' TurnPic Me, Picture1, Picture2, 150 '注意这里的150是角度
'End Sub
'===========================================================================
Private Declare Function PlgBlt Lib "gdi32" (ByVal hdcDest As Long, lpPoint As POINTAPI, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hbmMask As Long, ByVal xMask As Long, ByVal yMask As Long) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Const PI = 3.1415926576
Public Function TurnPic(ByVal ObjMe As Object, ByVal pObj1 As Object, ByVal pObj2 As Object, ByVal dThetaDeg As Double)
Dim pt(1 To 3) As POINTAPI, p4 As POINTAPI
Dim dx As Long, dy As Long
Dim I As Long, offsetX As Long, offsetY As Long
Dim Sida As Double
Dim MaxX As Long, MaxY As Long, MinX As Long, MinY As Long
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载