7,763
社区成员
发帖
与我相关
我的任务
分享
Picture1.FillStyle = 0
Picture1.FillColor = RGB(160, 130, 0) '外圈填充色
Picture1.DrawWidth = 1
Picture1.Circle (BaseX, BaseY), printR2 * 1.3, RGB(143, 122, 16) '画外圈圆
Option Explicit
Private Const PI = 3.1415926
Private Sub btnDrawCircle_Click()
Dim intR As Integer '圆的半径
Dim intRed As Integer 'RGB的R
Dim intGreen As Integer 'RGB的G
Dim intBlue As Integer 'RGB的B
Dim intP As Long
Dim X1 As Double
Dim Y1 As Double
Dim X2 As Double
Dim Y2 As Double
Dim delta As Double
Dim lngCount As Long
On Error GoTo errSub
intR = 2000
intRed = 143
intGreen = 122
intBlue = 16
lngCount = 1000
Rem 细分数:lngCount
delta = PI / lngCount
For intP = 0 To lngCount
X1 = intR * Cos(delta * intP + PI * 0.25)
Y1 = intR * Sin(delta * intP + PI * 0.25)
X2 = intR * Cos(-delta * intP + PI * 0.25)
Y2 = intR * Sin(-delta * intP + PI * 0.25)
picMap.Line (X1, Y1)-(X2, Y2), RGB(intRed / lngCount * intP, intGreen / lngCount * intP, intBlue / lngCount * intP)
Next intP
Exit Sub
errSub:
End Sub
Private Sub Form_Load()
With picMap
.Appearance = 0
.AutoRedraw = True
.FillStyle = 1
.DrawMode = 13
.DrawWidth = 1
.Width = 8000
.Height = 6000
End With
picMap.Scale (-4000, 3000)-(4000, -3000) '定义坐标系统,图片正中心是(0,0)
End Sub
Option Explicit
Private Const PI = 3.1415926
Private Sub btnDrawCircle_Click()
Dim intR As Integer '圆的半径
Dim intRed As Integer 'RGB的R
Dim intGreen As Integer 'RGB的G
Dim intBlue As Integer 'RGB的B
Dim intP As Long
Dim X1 As Double
Dim Y1 As Double
Dim X2 As Double
Dim Y2 As Double
Dim delta As Double
Dim lngCount As Long
On Error GoTo errSub
intR = 2000
intRed = 143
intGreen = 122
intBlue = 16
lngCount = 1000
Rem 细分数:lngCount
delta = PI / lngCount
For intP = 0 To lngCount
X1 = intR * Cos(delta * intP + PI * 0.5)
Y1 = intR * Sin(delta * intP + PI * 0.5)
X2 = intR * Cos(-delta * intP + PI * 0.5)
Y2 = intR * Sin(-delta * intP + PI * 0.5)
picMap.Line (X1, Y1)-(X2, Y2), RGB(intRed / lngCount * intP, intGreen / lngCount * intP, intBlue / lngCount * intP)
Next intP
Exit Sub
errSub:
End Sub
Private Sub Form_Load()
With picMap
.Appearance = 0
.AutoRedraw = True
.FillStyle = 1
.DrawMode = 13
.DrawWidth = 5
.Width = 8000
.Height = 6000
End With
picMap.Scale (-4000, 3000)-(4000, -3000) '定义坐标系统,图片正中心是(0,0)
End Sub
Option Explicit
Private Const PI = 3.1415926
Private Sub btnDrawCircle_Click()
Dim intR As Integer '圆的半径
Dim intRed As Integer 'RGB的R
Dim intGreen As Integer 'RGB的G
Dim intBlue As Integer 'RGB的B
Dim intP As Long
Dim X1 As Double
Dim Y1 As Double
Dim X2 As Double
Dim Y2 As Double
Dim delta As Double
On Error GoTo errSub
intR = 2000
intRed = 143
intGreen = 122
intBlue = 16
Rem 细分数:1000
delta = PI / 1000
For intP = 0 To 1000
X1 = intR * Cos(delta * intP)
Y1 = intR * Sin(delta * intP)
X2 = intR * Cos(-delta * intP)
Y2 = intR * Sin(-delta * intP)
picMap.Line (X1, Y1)-(X2, Y2), RGB(intRed / 1000 * intP, intGreen / 1000 * intP, intBlue / 1000 * intP)
Next intP
Exit Sub
errSub:
End Sub
Private Sub Form_Load()
With picMap
.Appearance = 0
.AutoRedraw = True
.FillStyle = 1
.DrawMode = 13
.DrawWidth = 5
.Width = 8000
.Height = 6000
End With
picMap.Scale (-4000, 3000)-(4000, -3000) '定义坐标系统,图片正中心是(0,0)
End Sub
Private Sub Command1_Click()
Dim bytR As Byte
Dim bytG As Byte
Dim bytB As Byte
Dim hBrush As Long
Dim OldMode As Integer
Dim RetVal As Integer
Dim StepSize As Integer
Dim X As Integer
Dim FillArea As RECT
Dim BaseX As Long
Dim BaseY As Long
Dim R2 As Long
Dim lngP As Long
Picture1.AutoRedraw = True
R2 = 1000
BaseX = 0.5 * Picture1.Width
BaseY = 0.5 * Picture1.Height
Picture1.DrawWidth = 1
For X = 255 To 1 Step -1
Picture1.Circle (BaseX, BaseY), (R2 / 255) * X, RGB(X, 0, 0)
Next X
Picture1.Refresh
End Sub
Private Sub Command2_Click()
DrawGradientRect Me.hDC, 10, 10, 200, 100, vbBlue, vbGreen, GRADIENT_FILL_RECT_V
Me.Refresh
End Sub