-
Notifications
You must be signed in to change notification settings - Fork 4
/
Bitmap.inc
235 lines (195 loc) · 7.21 KB
/
Bitmap.inc
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
//----------------------------------------
// ´úÂëÓÉGenlibVcl¹¤¾ß×Ô¶¯Éú³É¡£
// Copyright ? ying32. All Rights Reserved.
//
//----------------------------------------
function Bitmap_Create: TBitmap; cdecl;
begin
Result := TBitmap.Create;
end;
procedure Bitmap_Free(AObj: TBitmap); cdecl;
begin
AObj.Free;
end;
procedure Bitmap_Assign(AObj: TBitmap; Source: TPersistent); cdecl;
begin
AObj.Assign(Source);
end;
function Bitmap_HandleAllocated(AObj: TBitmap): LongBool; cdecl;
begin
Result := AObj.HandleAllocated;
end;
procedure Bitmap_LoadFromStream(AObj: TBitmap; Stream: TStream); cdecl;
begin
AObj.LoadFromStream(Stream);
end;
procedure Bitmap_SaveToStream(AObj: TBitmap; Stream: TStream); cdecl;
begin
AObj.SaveToStream(Stream);
end;
procedure Bitmap_SetSize(AObj: TBitmap; AWidth: Integer; AHeight: Integer); cdecl;
begin
AObj.SetSize(AWidth, AHeight);
end;
procedure Bitmap_LoadFromResourceName(AObj: TBitmap; Instance: NativeUInt; ResName: PWideChar); cdecl;
begin
AObj.LoadFromResourceName(Instance, ResName);
end;
procedure Bitmap_LoadFromResourceID(AObj: TBitmap; Instance: NativeUInt; ResID: Integer); cdecl;
begin
{$IFDEF MSWINDOWS}
AObj.LoadFromResourceID(Instance, ResID);
{$ENDIF MSWINDOWS}
end;
function Bitmap_Equals(AObj: TBitmap; Obj: TObject): LongBool; cdecl;
begin
Result := AObj.Equals(Obj);
end;
procedure Bitmap_LoadFromFile(AObj: TBitmap; Filename: PWideChar); cdecl;
begin
AObj.LoadFromFile(Filename);
end;
procedure Bitmap_SaveToFile(AObj: TBitmap; Filename: PWideChar); cdecl;
begin
AObj.SaveToFile(Filename);
end;
function Bitmap_GetNamePath(AObj: TBitmap): PWideChar; cdecl;
begin
Result := PWideChar(AObj.GetNamePath);
end;
function Bitmap_ClassName(AObj: TBitmap): PWideChar; cdecl;
begin
Result := ShortstrToPWideChar(AObj.ClassName);
end;
function Bitmap_GetHashCode(AObj: TBitmap): Integer; cdecl;
begin
Result := AObj.GetHashCode;
end;
function Bitmap_ToString(AObj: TBitmap): PWideChar; cdecl;
begin
Result := PWideChar(AObj.ToString);
end;
function Bitmap_GetCanvas(AObj: TBitmap): TCanvas; cdecl;
begin
Result := AObj.Canvas;
end;
function Bitmap_GetHandle(AObj: TBitmap): HBITMAP; cdecl;
begin
Result := AObj.Handle;
end;
procedure Bitmap_SetHandle(AObj: TBitmap; AValue: HBITMAP); cdecl;
begin
AObj.Handle := AValue;
end;
function Bitmap_GetPixelFormat(AObj: TBitmap): TPixelFormat; cdecl;
begin
Result := AObj.PixelFormat;
end;
procedure Bitmap_SetPixelFormat(AObj: TBitmap; AValue: TPixelFormat); cdecl;
begin
AObj.PixelFormat := AValue;
end;
function Bitmap_GetTransparentColor(AObj: TBitmap): TColor; cdecl;
begin
Result := AObj.TransparentColor;
end;
procedure Bitmap_SetTransparentColor(AObj: TBitmap; AValue: TColor); cdecl;
begin
AObj.TransparentColor := AValue;
end;
function Bitmap_GetEmpty(AObj: TBitmap): LongBool; cdecl;
begin
Result := AObj.Empty;
end;
function Bitmap_GetHeight(AObj: TBitmap): Integer; cdecl;
begin
Result := AObj.Height;
end;
procedure Bitmap_SetHeight(AObj: TBitmap; AValue: Integer); cdecl;
begin
AObj.Height := AValue;
end;
function Bitmap_GetModified(AObj: TBitmap): LongBool; cdecl;
begin
Result := AObj.Modified;
end;
procedure Bitmap_SetModified(AObj: TBitmap; AValue: LongBool); cdecl;
begin
AObj.Modified := AValue;
end;
function Bitmap_GetPaletteModified(AObj: TBitmap): LongBool; cdecl;
begin
Result := AObj.PaletteModified;
end;
procedure Bitmap_SetPaletteModified(AObj: TBitmap; AValue: LongBool); cdecl;
begin
AObj.PaletteModified := AValue;
end;
function Bitmap_GetTransparent(AObj: TBitmap): LongBool; cdecl;
begin
Result := AObj.Transparent;
end;
procedure Bitmap_SetTransparent(AObj: TBitmap; AValue: LongBool); cdecl;
begin
AObj.Transparent := AValue;
end;
function Bitmap_GetWidth(AObj: TBitmap): Integer; cdecl;
begin
Result := AObj.Width;
end;
procedure Bitmap_SetWidth(AObj: TBitmap; AValue: Integer); cdecl;
begin
AObj.Width := AValue;
end;
procedure Bitmap_SetOnChange(AObj: TBitmap; AEventId: NativeUInt); stdcall;
begin
if AEventId = 0 then
begin
AObj.OnChange := nil;
TEventClass.Remove(AObj, geChange);
Exit;
end;
AObj.OnChange := TEventClass.OnChange;
TEventClass.Add(AObj, geChange, AEventId);
end;
function Bitmap_GetScanLine(AObj: TBitmap; Row: Integer): Pointer; cdecl;
begin
Result := AObj.ScanLine[Row];
end;
exports
Bitmap_Create {$IFNDEF MSWINDOWS}name '_Bitmap_Create'{$ENDIF},
Bitmap_Free {$IFNDEF MSWINDOWS}name '_Bitmap_Free'{$ENDIF},
Bitmap_Assign {$IFNDEF MSWINDOWS}name '_Bitmap_Assign'{$ENDIF},
Bitmap_HandleAllocated {$IFNDEF MSWINDOWS}name '_Bitmap_HandleAllocated'{$ENDIF},
Bitmap_LoadFromStream {$IFNDEF MSWINDOWS}name '_Bitmap_LoadFromStream'{$ENDIF},
Bitmap_SaveToStream {$IFNDEF MSWINDOWS}name '_Bitmap_SaveToStream'{$ENDIF},
Bitmap_SetSize {$IFNDEF MSWINDOWS}name '_Bitmap_SetSize'{$ENDIF},
Bitmap_LoadFromResourceName {$IFNDEF MSWINDOWS}name '_Bitmap_LoadFromResourceName'{$ENDIF},
Bitmap_LoadFromResourceID {$IFNDEF MSWINDOWS}name '_Bitmap_LoadFromResourceID'{$ENDIF},
Bitmap_Equals {$IFNDEF MSWINDOWS}name '_Bitmap_Equals'{$ENDIF},
Bitmap_LoadFromFile {$IFNDEF MSWINDOWS}name '_Bitmap_LoadFromFile'{$ENDIF},
Bitmap_SaveToFile {$IFNDEF MSWINDOWS}name '_Bitmap_SaveToFile'{$ENDIF},
Bitmap_GetNamePath {$IFNDEF MSWINDOWS}name '_Bitmap_GetNamePath'{$ENDIF},
Bitmap_ClassName {$IFNDEF MSWINDOWS}name '_Bitmap_ClassName'{$ENDIF},
Bitmap_GetHashCode {$IFNDEF MSWINDOWS}name '_Bitmap_GetHashCode'{$ENDIF},
Bitmap_ToString {$IFNDEF MSWINDOWS}name '_Bitmap_ToString'{$ENDIF},
Bitmap_GetCanvas {$IFNDEF MSWINDOWS}name '_Bitmap_GetCanvas'{$ENDIF},
Bitmap_GetHandle {$IFNDEF MSWINDOWS}name '_Bitmap_GetHandle'{$ENDIF},
Bitmap_SetHandle {$IFNDEF MSWINDOWS}name '_Bitmap_SetHandle'{$ENDIF},
Bitmap_GetPixelFormat {$IFNDEF MSWINDOWS}name '_Bitmap_GetPixelFormat'{$ENDIF},
Bitmap_SetPixelFormat {$IFNDEF MSWINDOWS}name '_Bitmap_SetPixelFormat'{$ENDIF},
Bitmap_GetTransparentColor {$IFNDEF MSWINDOWS}name '_Bitmap_GetTransparentColor'{$ENDIF},
Bitmap_SetTransparentColor {$IFNDEF MSWINDOWS}name '_Bitmap_SetTransparentColor'{$ENDIF},
Bitmap_GetEmpty {$IFNDEF MSWINDOWS}name '_Bitmap_GetEmpty'{$ENDIF},
Bitmap_GetHeight {$IFNDEF MSWINDOWS}name '_Bitmap_GetHeight'{$ENDIF},
Bitmap_SetHeight {$IFNDEF MSWINDOWS}name '_Bitmap_SetHeight'{$ENDIF},
Bitmap_GetModified {$IFNDEF MSWINDOWS}name '_Bitmap_GetModified'{$ENDIF},
Bitmap_SetModified {$IFNDEF MSWINDOWS}name '_Bitmap_SetModified'{$ENDIF},
Bitmap_GetPaletteModified {$IFNDEF MSWINDOWS}name '_Bitmap_GetPaletteModified'{$ENDIF},
Bitmap_SetPaletteModified {$IFNDEF MSWINDOWS}name '_Bitmap_SetPaletteModified'{$ENDIF},
Bitmap_GetTransparent {$IFNDEF MSWINDOWS}name '_Bitmap_GetTransparent'{$ENDIF},
Bitmap_SetTransparent {$IFNDEF MSWINDOWS}name '_Bitmap_SetTransparent'{$ENDIF},
Bitmap_GetWidth {$IFNDEF MSWINDOWS}name '_Bitmap_GetWidth'{$ENDIF},
Bitmap_SetWidth {$IFNDEF MSWINDOWS}name '_Bitmap_SetWidth'{$ENDIF},
Bitmap_SetOnChange {$IFNDEF MSWINDOWS}name '_Bitmap_SetOnChange'{$ENDIF},
Bitmap_GetScanLine {$IFNDEF MSWINDOWS}name '_Bitmap_GetScanLine'{$ENDIF};