-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGDIPlusExtra.bas
67 lines (48 loc) · 1.79 KB
/
GDIPlusExtra.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Attribute VB_Name = "GDIPlusExtra"
Option Explicit
Private m_defaultBrushYellow As GDIPBrush
Private m_defaultBrushBlack As GDIPBrush
Private m_defaultBrushWhite As GDIPBrush
Public Brushes As Collection
Public Function CreateWebColour(ByVal theWebColour As String) As gdipluswrapper.Colour
Dim newColour As New Colour
newColour.SetColourByHex theWebColour
Set CreateWebColour = newColour
End Function
Public Function Custom_Brush(ByVal theColour As Colour) As GDIPBrush
'FFFCA1
Dim m_defaultBrush As New GDIPBrush
m_defaultBrush.Colour = theColour
Set Custom_Brush = m_defaultBrush
End Function
Public Function Brushes_White() As GDIPBrush
If m_defaultBrushWhite Is Nothing Then
Set m_defaultBrushWhite = New GDIPBrush
m_defaultBrushWhite.Colour = CreateColour(vbWhite)
End If
Set Brushes_White = m_defaultBrushWhite
End Function
Public Function Brushes_Black() As GDIPBrush
If m_defaultBrushBlack Is Nothing Then
Set m_defaultBrushBlack = New GDIPBrush
m_defaultBrushBlack.Colour = CreateColour(vbBlack)
End If
Set Brushes_Black = m_defaultBrushBlack
End Function
Public Function Brushes_Yellow() As GDIPBrush
If m_defaultBrushYellow Is Nothing Then
Set m_defaultBrushYellow = New GDIPBrush
m_defaultBrushYellow.Colour = CreateColour(vbYellow)
End If
Set Brushes_Yellow = m_defaultBrushYellow
End Function
Public Function CreateColour(theColour As ColorConstants) As Colour
Dim newColour As New Colour
newColour.Value = theColour
Set CreateColour = newColour
End Function
Public Function CreateFontFamily(szFontName As String) As GDIPFontFamily
Dim newFontFamily As New GDIPFontFamily
newFontFamily.Constructor szFontName
Set CreateFontFamily = newFontFamily
End Function