📄 apicolour.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "ApiColour"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
' ##MODULE_DESCRIPTION This class is used to split convert colours between the _
(Red,Green,Blue) representation and the windows COLORREF representation.
'\\ --[ApiColour]--------------------------------------------------
'\\ Utility class for making RGBQUADS from their respective colour
'\\ components
'\\ ---------------------------------------------------------------
'\\ (c) 2001 Merrion Computing Ltd
Private mColourRef As Long
Public Property Let Blue(ByVal newval As Byte)
With APIDispenser
mColourRef = .MakeLong(.MakeInt(Me.Red, Me.Green), .MakeInt(newval, 0))
End With
End Property
Friend Property Let ColourRef(ByVal newref As Long)
mColourRef = newref
End Property
Friend Property Get ColourRef() As Long
ColourRef = mColourRef
End Property
Public Property Get Description() As String
Dim sdesc As String
sdesc = "COLOUR:Red=" & Me.Red & ",Green=" & Me.Green & ",Blue=" & Me.Blue
Description = sdesc
End Property
Public Property Let Green(ByVal newval As Byte)
With APIDispenser
mColourRef = .MakeLong(.MakeInt(Me.Red, newval), .MakeInt(Me.Blue, 0))
End With
End Property
Public Property Let Red(ByVal newval As Byte)
With APIDispenser
mColourRef = .MakeLong(.MakeInt(newval, Me.Green), .MakeInt(Me.Blue, 0))
End With
End Property
Public Property Get Red() As Byte
Red = APIDispenser.LoByte(APIDispenser.LoWord(mColourRef))
End Property
Public Property Get Green() As Byte
Green = APIDispenser.hiByte(APIDispenser.LoWord(mColourRef))
End Property
Public Property Get Blue() As Byte
Blue = APIDispenser.LoByte(APIDispenser.HiWord(mColourRef))
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -