📄 fade.frm
字号:
VERSION 5.00
Object = "*\A..\SOURCE\FAST2002.vbp"
Begin VB.Form frmGDI
BorderStyle = 3 'Fixed Dialog
Caption = "GDI class demo"
ClientHeight = 5415
ClientLeft = 45
ClientTop = 330
ClientWidth = 8940
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Icon = "Fade.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5415
ScaleWidth = 8940
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.ComboBox cboStyles
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
ItemData = "Fade.frx":0442
Left = 4995
List = "Fade.frx":044F
Style = 2 'Dropdown List
TabIndex = 3
Top = 225
Width = 1680
End
Begin VB.ComboBox cboColors
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
ItemData = "Fade.frx":0473
Left = 2835
List = "Fade.frx":0480
Style = 2 'Dropdown List
TabIndex = 2
Top = 225
Width = 1680
End
Begin VB.OptionButton optLight
Caption = "Dark to light"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 1
Left = 315
TabIndex = 1
Top = 585
UseMaskColor = -1 'True
Value = -1 'True
Width = 1365
End
Begin VB.OptionButton optLight
Caption = "Light to dark"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 195
Index = 0
Left = 315
TabIndex = 0
Top = 270
Width = 1545
End
Begin FLWGraphMath.FWGDI objGDI
Left = 690
Top = 1710
_ExtentX = 820
_ExtentY = 820
End
End
Attribute VB_Name = "frmGDI"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
Call objGDI.Create(Me.hWnd)
cboColors.ListIndex = 2
cboStyles.ListIndex = 2
End Sub
Private Sub cboColors_Click()
Call Form_Paint
End Sub
Private Sub cboStyles_Click()
Call Form_Paint
End Sub
Private Sub optLight_Click(Index As Integer)
Call Form_Paint
End Sub
Private Sub Form_Paint()
Dim intFadeLight As FLWCommon.flwFadeLight
Dim intFadeColor As FLWCommon.flwFadeColor
Dim intFadeStyle As FLWCommon.flwFadeModes
Dim intInd As Integer
Dim objPoints As New FLWGraphMath.IFWGDIPoints
If optLight(0).Value Then
intFadeLight = FLWCommon.flwFadeLightToDark
Else
intFadeLight = FLWCommon.flwFadeDarkToLight
End If
Select Case cboColors.ListIndex
Case 0
intFadeColor = FLWCommon.flwFadeRed
Case 1
intFadeColor = FLWCommon.flwFadeGreen
Case 2
intFadeColor = FLWCommon.flwFadeBlue
End Select
Select Case cboStyles.ListIndex
Case 0
intFadeStyle = FLWCommon.flwFadeHorizontal
Case 1
intFadeStyle = FLWCommon.flwFadeVertical
Case 2
intFadeStyle = FLWCommon.flwFadeBoth
End Select
Call objGDI.Fade(intFadeStyle, intFadeLight, intFadeColor)
objGDI.BackColor = vbWhite
objGDI.LineWidth = 1
objGDI.LineStyle = FLWGraphMath.flwBSDot
objGDI.FillColor = vbRed
objGDI.FillStyle = FLWGraphMath.flwSolid
Call objGDI.Polygon(120, 120, 5, 50)
Call objGDI.Ellipse(200, 100, 50, 90)
Call objGDI.Ellipse(200, 100, 90, 50)
objGDI.LineStyle = FLWGraphMath.flwTransparent
objGDI.BackColor = vbYellow
objGDI.LineWidth = 2
objGDI.FillColor = vbBlue
Call objGDI.xCircle(200, 100, 50)
objGDI.LineWidth = 5
objGDI.BackColor = vbYellow
objGDI.Pixel(175, 210) = vbYellow
objGDI.Pixel(225, 210) = vbYellow
objGDI.LineStyle = FLWGraphMath.flwBSSolid
Call objGDI.xLine(175, 220, 225, 220)
Call objGDI.Rectangle(300, 100, 350, 200)
objGDI.TextFont.Name = "Arial"
objGDI.TextFont.Size = 14
objGDI.TextFont.Italic = True
objGDI.TextFont.Bold = True
objGDI.CurrentX = 400
objGDI.CurrentY = 300
For intInd = 0 To 11
objGDI.TextFont.Angle = intInd * 30
Call objGDI.Text("Rotate " & objGDI.TextFont.Angle & " degress")
Next
objGDI.FillStyle = FLWGraphMath.flwSolid
objGDI.FillColor = vbYellow
Call objPoints.Add(100, 200)
Call objPoints.Add(150, 250)
Call objPoints.Add(100, 300)
Call objPoints.Add(50, 250)
Call objPoints.Add(20, 220)
Call objGDI.Region(objPoints)
' fills a region
'objGDI.FillColor = vbGreen
'Call objGDI.Fill(110, 250, vbYellow, flwFooldFillSurface)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -