?? getcolor.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "顏色拾取器"
ClientHeight = 1140
ClientLeft = 60
ClientTop = 345
ClientWidth = 4590
Icon = "getcolor.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1140
ScaleWidth = 4590
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 270
Left = 3480
TabIndex = 6
Top = 0
Width = 1095
End
Begin VB.Timer Timer1
Interval = 100
Left = 240
Top = 720
End
Begin VB.CommandButton Command1
Caption = "退出"
Height = 375
Left = 3720
TabIndex = 5
Top = 720
Width = 855
End
Begin VB.PictureBox Picture1
Height = 615
Left = 120
ScaleHeight = 555
ScaleWidth = 555
TabIndex = 0
Top = 120
Width = 615
End
Begin VB.Label Label4
Caption = "網頁顏色"
Height = 255
Left = 840
TabIndex = 4
Top = 840
Width = 2775
End
Begin VB.Label Label3
Caption = "16進制色"
Height = 255
Left = 840
TabIndex = 3
Top = 600
Width = 2775
End
Begin VB.Label Label2
Caption = "點的RGB"
Height = 255
Left = 840
TabIndex = 2
Top = 360
Width = 2655
End
Begin VB.Label Label1
Caption = "點的位置"
Height = 255
Left = 840
TabIndex = 1
Top = 120
Width = 2535
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim z As pointapi
Dim a As Long
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Timer1_Timer()
Dim b, c, d As Long
GetCursorPos z
Label1.Caption = "點的位置:(" & z.X & ":" & z.Y & ")"
Label2.Caption = "Y:" & z.Y
a = GetPixel(GetDC(0), z.X, z.Y)
b = a And &HFF
c = (a And 65280) \ 256
d = (a And &HFF0000) \ 65536
Label2.Caption = "點的RGB(" & b & "," & c & "," & d & ")"
Label3.Caption = "16進制色:0X" & Hex(a)
Label4.Caption = "網頁顏色:#" & Hex(a)
Picture1.BackColor = RGB(b, c, d)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -