⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getcolor.frm

📁 颜色拾取器
💻 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 + -