📄 testrotate.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5745
ClientLeft = 2250
ClientTop = 2025
ClientWidth = 6420
LinkTopic = "Form1"
ScaleHeight = 383
ScaleMode = 3 'Pixel
ScaleWidth = 428
Begin VB.PictureBox PicCon
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 1050
Left = 0
Picture = "TestRotate.frx":0000
ScaleHeight = 70
ScaleMode = 3 'Pixel
ScaleWidth = 56
TabIndex = 2
Top = 0
Width = 840
End
Begin VB.PictureBox Pic1
AutoRedraw = -1 'True
BackColor = &H00FFFFC0&
BorderStyle = 0 'None
Height = 1695
Left = 3360
ScaleHeight = 113
ScaleMode = 3 'Pixel
ScaleWidth = 121
TabIndex = 1
Top = 600
Width = 1815
End
Begin VB.Label Label1
Caption = "Label1"
Height = 255
Left = 1680
TabIndex = 0
Top = 240
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function FoxRotate Lib "FoxCBmp3.dl" (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 Angle As Double, Optional ByVal MaskColor As Long, Optional ByVal Flags As FoxFlags) As Long
Private Declare Function InvalidateRect Lib "user32" (ByVal hwnd As Long, ByVal lpRect As Long, ByVal bErase As Long) As Long
Enum FoxFlags
bad = &H1
Good = &H3
End Enum
Const Pi = 3.141592654
Private Sub Form_Load()
With Pic1
.Width = Sqr(PicCon.Width ^ 2 + PicCon.Height ^ 2)
.Height = .Width
End With
Pic1.AutoRedraw = True
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
On Error Resume Next
Dim A As Integer
A = -Atn((X - Pic1.Left - Pic1.Width / 2) / (Y - Pic1.Top - Pic1.Height / 2)) * 180 / Pi
If Y < Pic1.Top + Pic1.Height / 2 Then A = A + 180
Label1.Caption = A
Pic1.Cls
FoxRotate Pic1.hdc, Pic1.Width / 2, Pic1.Height / 2, PicCon.Width, PicCon.Height, PicCon.hdc, 0, 0, A, &HFF00FF, Good ' bad '
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -