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

📄 frmcolourise.frm

📁 Visual Basic image processing. Mainly it occupies some filters to detect some prperties of image. Re
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmColourise 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Choose Hue:"
   ClientHeight    =   1980
   ClientLeft      =   5205
   ClientTop       =   4320
   ClientWidth     =   3840
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmColourise.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1980
   ScaleWidth      =   3840
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.Frame fraSep 
      Height          =   75
      Left            =   -360
      TabIndex        =   6
      Top             =   1380
      Width           =   4275
   End
   Begin VB.PictureBox picSelected 
      Height          =   315
      Left            =   900
      ScaleHeight     =   255
      ScaleWidth      =   975
      TabIndex        =   3
      Top             =   960
      Width           =   1035
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   2520
      TabIndex        =   2
      Top             =   1500
      Width           =   1275
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   1200
      TabIndex        =   1
      Top             =   1500
      Width           =   1275
   End
   Begin VB.PictureBox picHue 
      AutoRedraw      =   -1  'True
      Height          =   315
      Left            =   120
      ScaleHeight     =   255
      ScaleWidth      =   3600
      TabIndex        =   0
      Top             =   540
      Width           =   3660
   End
   Begin VB.Label lblSelected 
      Caption         =   "Selected:"
      Height          =   195
      Left            =   120
      TabIndex        =   5
      Top             =   960
      Width           =   795
   End
   Begin VB.Label lblInfo 
      Caption         =   "Click on the saturated hue box below to choose the colour:"
      Height          =   435
      Left            =   120
      TabIndex        =   4
      Top             =   60
      Width           =   3675
   End
End
Attribute VB_Name = "frmColourise"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_bCancel As Boolean
Private m_fHue As Single

Public Property Get Cancelled() As Boolean
   Cancelled = m_bCancel
End Property

Public Property Get Hue() As Single
   Hue = m_fHue
End Property

Private Sub cmdCancel_Click()
   Unload Me
End Sub

Private Sub cmdOK_Click()
   m_bCancel = False
   Unload Me
End Sub

Private Sub Form_Load()
Dim h As Single
Dim r As Long, g As Long, b As Long
Dim lH As Long
Dim x As Long
   m_bCancel = True
   lH = picHue.ScaleHeight
   For h = -40 To 200
      HLSToRGB h / 40, 1, 0.5, r, g, b
      picHue.Line (x, 0)-(x + Screen.TwipsPerPixelX, lH), RGB(r, g, b), BF
      x = x + Screen.TwipsPerPixelX
   Next h
   picHue.Refresh
   picHue_MouseDown 1, 0, 0, 0
End Sub

Private Sub picHue_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim r As Long, g As Long, b As Long
   If (x > 0) And (y > 0) And (x < picHue.ScaleWidth) And (y < picHue.ScaleHeight) Then
      m_fHue = ((x \ Screen.TwipsPerPixelX) - 40) / 40
      HLSToRGB m_fHue, 1, 0.5, r, g, b
      picSelected.BackColor = RGB(r, g, b)
   End If

End Sub

Private Sub picHue_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
   If (Button And vbLeftButton) = vbLeftButton Then
      picHue_MouseDown Button, Shift, x, y
   End If

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -