📄 txteffcts2.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1
Caption = "渐变文本"
ClientHeight = 3585
ClientLeft = 60
ClientTop = 345
ClientWidth = 5535
LinkTopic = "Form1"
ScaleHeight = 3585
ScaleWidth = 5535
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdSave
Caption = "保存..."
Height = 375
Left = 3000
TabIndex = 10
Top = 1200
Width = 1695
End
Begin MSComDlg.CommonDialog CDlg
Left = 1320
Top = 2280
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.OptionButton optGradient
Caption = "球形渐变"
Height = 255
Index = 2
Left = 3240
TabIndex = 8
Top = 840
Width = 2055
End
Begin VB.OptionButton optGradient
Caption = "矩形渐变"
Height = 255
Index = 1
Left = 3240
TabIndex = 7
Top = 480
Width = 2055
End
Begin VB.OptionButton optGradient
Caption = "水平渐变"
Height = 255
Index = 0
Left = 3240
TabIndex = 6
Top = 120
Value = -1 'True
Width = 2055
End
Begin VB.TextBox Text1
Height = 495
Left = 120
TabIndex = 2
Text = "渐变文本演示"
Top = 1680
Width = 5295
End
Begin VB.CommandButton cmdGo
Caption = "执行"
Height = 375
Left = 840
TabIndex = 1
Top = 1200
Width = 1740
End
Begin VB.PictureBox picResult
AutoRedraw = -1 'True
BackColor = &H00FF00FF&
BeginProperty Font
Name = "宋体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1020
Left = 120
ScaleHeight = 960
ScaleWidth = 960
TabIndex = 0
Top = 2280
Width = 1020
End
Begin VB.PictureBox PicTmp
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 8.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1095
Left = 1920
ScaleHeight = 1035
ScaleWidth = 1155
TabIndex = 9
Top = 2280
Visible = 0 'False
Width = 1215
End
Begin VB.Label Color2Box
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00FF0000&
BorderStyle = 1 'Fixed Single
Caption = "渐变色-2"
ForeColor = &H000000C0&
Height = 975
Left = 1680
TabIndex = 5
Top = 120
Width = 1455
WordWrap = -1 'True
End
Begin VB.Label Color1Box
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00000000&
BorderStyle = 1 'Fixed Single
Caption = "渐变色-1 "
ForeColor = &H000000C0&
Height = 975
Left = 120
TabIndex = 4
Top = 120
Width = 1455
WordWrap = -1 'True
End
Begin VB.Label txtLen
AutoSize = -1 'True
BorderStyle = 1 'Fixed Single
Caption = "Label1"
Height = 240
Left = 3600
TabIndex = 3
Top = 2280
Visible = 0 'False
Width = 600
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim GradType As Integer
'gradtype flage:
' 1) horizontal
' 2) rectangular
' 3) spherical
Private Sub cmdGo_Click()
DrawTxt True, Text1.Text, Color1Box.BackColor, Color2Box.BackColor, GradType
End Sub
Private Sub cmdSave_Click()
CDlg.Filter = "Bitmap(*.bmp)|*.bmp|All files(*.*)|*.*"
CDlg.ShowSave
If CDlg.FileName <> "" Then
SavePicture picResult.Image, CDlg.FileName
End If
End Sub
Private Sub Color1Box_Click()
CDlg.ShowColor
Color1Box.BackColor = CDlg.Color
End Sub
Private Sub Color2Box_Click()
CDlg.ShowColor
Color2Box.BackColor = CDlg.Color
End Sub
Private Sub Form_Load()
Color1Box.Caption = "渐变色-1" & vbCrLf & "(单击改变颜色)"
Color2Box.Caption = "渐变色-2" & vbCrLf & "(单击改变颜色)"
PicTmp.AutoRedraw = True
PicTmp.FontSize = 20
GradType = 1
cmdGo_Click
End Sub
Private Sub optGradient_Click(Index As Integer)
GradType = Index + 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -