-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitmap.go
190 lines (143 loc) · 4.03 KB
/
bitmap.go
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
//----------------------------------------
// 代码由GenlibVcl工具自动生成。
// Copyright © ying32. All Rights Reserved.
//
//----------------------------------------
package vcl
import (
. "gitee.com/ying32/govcl/vcl/api"
. "gitee.com/ying32/govcl/vcl/types"
)
type TBitmap struct {
IObject
instance uintptr
}
func NewBitmap() *TBitmap {
b := new(TBitmap)
b.instance = Bitmap_Create()
return b
}
func BitmapFromInst(inst uintptr) *TBitmap {
b := new(TBitmap)
b.instance = inst
return b
}
func BitmapFromObj(obj IObject) *TBitmap {
b := new(TBitmap)
b.instance = CheckPtr(obj)
return b
}
func (b *TBitmap) Free() {
if b.instance != 0 {
Bitmap_Free(b.instance)
b.instance = 0
}
}
func (b *TBitmap) Instance() uintptr {
return b.instance
}
func (b *TBitmap) IsValid() bool {
return b.instance != 0
}
func (b *TBitmap) Assign(Source IObject) {
Bitmap_Assign(b.instance, CheckPtr(Source))
}
func (b *TBitmap) HandleAllocated() bool {
return Bitmap_HandleAllocated(b.instance)
}
func (b *TBitmap) LoadFromStream(Stream IObject) {
Bitmap_LoadFromStream(b.instance, CheckPtr(Stream))
}
func (b *TBitmap) SaveToStream(Stream IObject) {
Bitmap_SaveToStream(b.instance, CheckPtr(Stream))
}
func (b *TBitmap) SetSize(AWidth int32, AHeight int32) {
Bitmap_SetSize(b.instance, AWidth , AHeight)
}
func (b *TBitmap) LoadFromResourceName(Instance uintptr, ResName string) {
Bitmap_LoadFromResourceName(b.instance, Instance , ResName)
}
func (b *TBitmap) LoadFromResourceID(Instance uintptr, ResID int32) {
Bitmap_LoadFromResourceID(b.instance, Instance , ResID)
}
func (b *TBitmap) Equals(Obj IObject) bool {
return Bitmap_Equals(b.instance, CheckPtr(Obj))
}
func (b *TBitmap) LoadFromFile(Filename string) {
Bitmap_LoadFromFile(b.instance, Filename)
}
func (b *TBitmap) SaveToFile(Filename string) {
Bitmap_SaveToFile(b.instance, Filename)
}
func (b *TBitmap) GetNamePath() string {
return Bitmap_GetNamePath(b.instance)
}
func (b *TBitmap) ClassName() string {
return Bitmap_ClassName(b.instance)
}
func (b *TBitmap) GetHashCode() int32 {
return Bitmap_GetHashCode(b.instance)
}
func (b *TBitmap) ToString() string {
return Bitmap_ToString(b.instance)
}
func (b *TBitmap) Canvas() *TCanvas {
return CanvasFromInst(Bitmap_GetCanvas(b.instance))
}
func (b *TBitmap) Handle() HBITMAP {
return Bitmap_GetHandle(b.instance)
}
func (b *TBitmap) SetHandle(value HBITMAP) {
Bitmap_SetHandle(b.instance, value)
}
func (b *TBitmap) PixelFormat() TPixelFormat {
return Bitmap_GetPixelFormat(b.instance)
}
func (b *TBitmap) SetPixelFormat(value TPixelFormat) {
Bitmap_SetPixelFormat(b.instance, value)
}
func (b *TBitmap) TransparentColor() TColor {
return Bitmap_GetTransparentColor(b.instance)
}
func (b *TBitmap) SetTransparentColor(value TColor) {
Bitmap_SetTransparentColor(b.instance, value)
}
func (b *TBitmap) Empty() bool {
return Bitmap_GetEmpty(b.instance)
}
func (b *TBitmap) Height() int32 {
return Bitmap_GetHeight(b.instance)
}
func (b *TBitmap) SetHeight(value int32) {
Bitmap_SetHeight(b.instance, value)
}
func (b *TBitmap) Modified() bool {
return Bitmap_GetModified(b.instance)
}
func (b *TBitmap) SetModified(value bool) {
Bitmap_SetModified(b.instance, value)
}
func (b *TBitmap) PaletteModified() bool {
return Bitmap_GetPaletteModified(b.instance)
}
func (b *TBitmap) SetPaletteModified(value bool) {
Bitmap_SetPaletteModified(b.instance, value)
}
func (b *TBitmap) Transparent() bool {
return Bitmap_GetTransparent(b.instance)
}
func (b *TBitmap) SetTransparent(value bool) {
Bitmap_SetTransparent(b.instance, value)
}
func (b *TBitmap) Width() int32 {
return Bitmap_GetWidth(b.instance)
}
func (b *TBitmap) SetWidth(value int32) {
Bitmap_SetWidth(b.instance, value)
}
func (b *TBitmap) SetOnChange(fn TNotifyEvent) {
Bitmap_SetOnChange(b.instance, fn)
}
func (b *TBitmap) ScanLine(Row int32) uintptr {
return Bitmap_GetScanLine(b.instance, Row)
}