forked from lee-soft/ViPad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PickGrid.cls
68 lines (52 loc) · 1.72 KB
/
PickGrid.cls
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
67
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "PickGrid"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Private m_whiteText As GDIPGraphicPath
Private m_blackText As GDIPGraphicPath
Private m_graphicsImage As GDIPGraphics
Private m_currentBitmap As GDIPBitmap
Public Items As Collection
Public Function ClearTextGraphicPaths()
Set m_blackText = New GDIPGraphicPath
Set m_whiteText = New GDIPGraphicPath
End Function
Public Property Get GraphicsImage() As GDIPGraphics
Set GraphicsImage = m_graphicsImage
End Property
Public Property Get WhiteTextGP() As GDIPGraphicPath
Set WhiteTextGP = m_whiteText
End Property
Public Property Get BlackTextGP() As GDIPGraphicPath
Set BlackTextGP = m_blackText
End Property
Public Property Get Bitmap() As GDIPBitmap
Set Bitmap = m_currentBitmap
End Property
Private Sub Class_Initialize()
Set m_currentBitmap = New GDIPBitmap
ClearTextGraphicPaths
End Sub
Public Property Let WindowSize(newSize As SIZEL)
Set m_graphicsImage = New GDIPGraphics
m_currentBitmap.CreateFromSizeFormat newSize.Width, newSize.Height, PixelFormat.Format32bppArgb
m_graphicsImage.FromImage m_currentBitmap.Image
m_graphicsImage.SmoothingMode = SmoothingModeHighQuality
m_graphicsImage.InterpolationMode = InterpolationModeHighQualityBicubic
End Property
Private Sub Class_Terminate()
m_currentBitmap.Dispose
m_whiteText.Dispose
m_blackText.Dispose
m_currentBitmap.Dispose
End Sub