source: trunk/ab5.0/ablib/src/api_gdi.sbp

Last change on this file was 700, checked in by イグトランス (egtra), 15 years ago

GdiPlusEnums.abの列挙体を名前空間System.Drawing以下に配置

File size: 57.7 KB
Line 
1' api_gdi.sbp - Graphics Device Integerface API
2
3#ifdef UNICODE
4Const _FuncName_CopyEnhMetaFile = "CopyEnhMetaFileW"
5Const _FuncName_CopyMetaFile = "CopyMetaFileW"
6Const _FuncName_CreateDC = "CreateDCW"
7Const _FuncName_CreateEnhMetaFile = "CreateEnhMetaFileW"
8Const _FuncName_CreateMetaFile = "CreateMetaFileW"
9Const _FuncName_CreateFont = "CreateFontW"
10Const _FuncName_CreateFontIndirect = "CreateFontIndirectW"
11Const _FuncName_GetEnhMetaFile = "GetEnhMetaFileW"
12Const _FuncName_GetEnhMetaFileDescription = "GetEnhMetaFileDescriptionW"
13Const _FuncName_GetObject = "GetObjectW"
14Const _FuncName_GetTextFace = "GetTextFaceW"
15Const _FuncName_GetTextMetrics = "GetTextMetricsW"
16Const _FuncName_ResetDC = "ResetDCW"
17Const _FuncName_StartDoc = "StartDocW"
18Const _FuncName_wglUseFontBitmaps = "wglUseFontBitmapsW"
19Const _FuncName_wglUseFontOutlines = "wglUseFontOutlinesW"
20#else
21Const _FuncName_CopyEnhMetaFile = "CopyEnhMetaFileA"
22Const _FuncName_CopyMetaFile = "CopyMetaFileA"
23Const _FuncName_CreateDC = "CreateDCA"
24Const _FuncName_CreateEnhMetaFile = "CreateEnhMetaFileA"
25Const _FuncName_CreateMetaFile = "CreateMetaFileA"
26Const _FuncName_CreateFont = "CreateFontA"
27Const _FuncName_CreateFontIndirect = "CreateFontIndirectA"
28Const _FuncName_GetEnhMetaFile = "GetEnhMetaFileA"
29Const _FuncName_GetEnhMetaFileDescription = "GetEnhMetaFileDescriptionA"
30Const _FuncName_GetObject = "GetObjectA"
31Const _FuncName_GetTextFace = "GetTextFaceA"
32Const _FuncName_GetTextMetrics = "GetTextMetricsA"
33Const _FuncName_ResetDC = "ResetDCA"
34Const _FuncName_StartDoc = "StartDocA"
35Const _FuncName_wglUseFontBitmaps = "wglUseFontBitmapsA"
36Const _FuncName_wglUseFontOutlines = "wglUseFontOutlinesA"
37#endif
38
39Const CLR_INVALID = &HFFFFFFFF
40Const GDI_ERROR = &HFFFFFFFF
41
42TypeDef BCHAR = TBYTE
43
44' Metafile and EnhancedMetafile
45Type EMR
46 iType As DWord
47 nSize As DWord
48End Type
49
50Type Align(2) METAHEADER
51 mtType As Word
52 mtHeaderSize As Word
53 mtVersion As Word
54 mtSize As DWord
55 mtNoObjects As Word
56 mtMaxRecord As DWord
57 mtNoParameters As Word
58End Type
59TypeDef PMETAHEADER = *METAHEADER
60
61Type ENHMETAHEADER
62 iType As DWord
63 nSize As DWord
64 rclBounds As RECT
65 rclFrame As RECT
66 dSignature As DWord
67 nVersion As DWord
68 nBytes As DWord
69 nRecords As DWord
70 nHandles As Word
71 sReserved As Word
72 nDescription As DWord
73 offDescription As DWord
74 nPalEntries As DWord
75 szlDevice As SIZE
76 szlMillimeters As SIZE
77 cbPixelFormat As DWord
78 offPixelFormat As DWord
79 bOpenGL As DWord
80'#if WINVER >= 0x0500
81 'szlMicrometers As SIZE
82'#endif
83End Type
84TypeDef PENHMETAHEADER = *ENHMETAHEADER
85
86
87
88Type HANDLETABLE
89 objectHandle[ELM(1)] As HGDIOBJ
90End Type
91
92Type METARECORD
93 rdSize As DWord
94 rdFunction As Word
95 rdParm[ELM(1)] As Word
96End Type
97
98Type ENHMETARECORD
99 iType As DWord
100 nSize As DWord
101 dParm[ELM(1)] As DWord
102End Type
103
104Type METAFILEPICT
105 mm As Long
106 xExt As Long
107 yExt As Long
108 hMF As HMETAFILE
109End Type
110
111TypeDef ENHMFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef EMFR As ENHMETARECORD, nObj As Long, lpData As LPARAM) As Long
112TypeDef MFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef MFR As METARECORD, nObj As Long, lpClientData As LPARAM) As Long
113
114Const META_SETBKCOLOR = &h0201
115Const META_SETBKMODE = &h0102
116Const META_SETMAPMODE = &h0103
117Const META_SETROP2 = &h0104
118Const META_SETRELABS = &h0105
119Const META_SETPOLYFILLMODE = &h0106
120Const META_SETSTRETCHBLTMODE = &h0107
121Const META_SETTEXTCHAREXTRA = &h0108
122Const META_SETTEXTCOLOR = &h0209
123Const META_SETTEXTJUSTIFICATION = &h020A
124Const META_SETWINDOWORG = &h020B
125Const META_SETWINDOWEXT = &h020C
126Const META_SETVIEWPORTORG = &h020D
127Const META_SETVIEWPORTEXT = &h020E
128Const META_OFFSETWINDOWORG = &h020F
129Const META_SCALEWINDOWEXT = &h0410
130Const META_OFFSETVIEWPORTORG = &h0211
131Const META_SCALEVIEWPORTEXT = &h0412
132Const META_LINETO = &h0213
133Const META_MOVETO = &h0214
134Const META_EXCLUDECLIPRECT = &h0415
135Const META_INTERSECTCLIPRECT = &h0416
136Const META_ARC = &h0817
137Const META_ELLIPSE = &h0418
138Const META_FLOODFILL = &h0419
139Const META_PIE = &h081A
140Const META_RECTANGLE = &h041B
141Const META_ROUNDRECT = &h061C
142Const META_PATBLT = &h061D
143Const META_SAVEDC = &h001E
144Const META_SETPIXEL = &h041F
145Const META_OFFSETCLIPRGN = &h0220
146Const META_TEXTOUT = &h0521
147Const META_BITBLT = &h0922
148Const META_STRETCHBLT = &h0B23
149Const META_POLYGON = &h0324
150Const META_POLYLINE = &h0325
151Const META_ESCAPE = &h0626
152Const META_RESTOREDC = &h0127
153Const META_FILLREGION = &h0228
154Const META_FRAMEREGION = &h0429
155Const META_INVERTREGION = &h012A
156Const META_PAINTREGION = &h012B
157Const META_SELECTCLIPREGION = &h012C
158Const META_SELECTOBJECT = &h012D
159Const META_SETTEXTALIGN = &h012E
160Const META_CHORD = &h0830
161Const META_SETMAPPERFLAGS = &h0231
162Const META_EXTTEXTOUT = &h0a32
163Const META_SETDIBTODEV = &h0d33
164Const META_SELECTPALETTE = &h0234
165Const META_REALIZEPALETTE = &h0035
166Const META_ANIMATEPALETTE = &h0436
167Const META_SETPALENTRIES = &h0037
168Const META_POLYPOLYGON = &h0538
169Const META_RESIZEPALETTE = &h0139
170Const META_DIBBITBLT = &h0940
171Const META_DIBSTRETCHBLT = &h0b41
172Const META_DIBCREATEPATTERNBRUSH = &h0142
173Const META_STRETCHDIB = &h0f43
174Const META_EXTFLOODFILL = &h0548
175'#if WINVER >= &h0500
176Const META_SETLAYOUT = &h0149
177'#endif
178Const META_DELETEOBJECT = &h01f0
179Const META_CREATEPALETTE = &h00f7
180Const META_CREATEPATTERNBRUSH = &h01F9
181Const META_CREATEPENINDIRECT = &h02FA
182Const META_CREATEFONTINDIRECT = &h02FB
183Const META_CREATEBRUSHINDIRECT = &h02FC
184Const META_CREATEREGION = &h06FF
185
186Const EMR_HEADER = 1
187Const EMR_POLYBEZIER = 2
188Const EMR_POLYGON = 3
189Const EMR_POLYLINE = 4
190Const EMR_POLYBEZIERTO = 5
191Const EMR_POLYLINETO = 6
192Const EMR_POLYPOLYLINE = 7
193Const EMR_POLYPOLYGON = 8
194Const EMR_SETWINDOWEXTEX = 9
195Const EMR_SETWINDOWORGEX = 10
196Const EMR_SETVIEWPORTEXTEX = 11
197Const EMR_SETVIEWPORTORGEX = 12
198Const EMR_SETBRUSHORGEX = 13
199Const EMR_EOF = 14
200Const EMR_SETPIXELV = 15
201Const EMR_SETMAPPERFLAGS = 16
202Const EMR_SETMAPMODE = 17
203Const EMR_SETBKMODE = 18
204Const EMR_SETPOLYFILLMODE = 19
205Const EMR_SETROP2 = 20
206Const EMR_SETSTRETCHBLTMODE = 21
207Const EMR_SETTEXTALIGN = 22
208Const EMR_SETCOLORADJUSTMENT = 23
209Const EMR_SETTEXTCOLOR = 24
210Const EMR_SETBKCOLOR = 25
211Const EMR_OFFSETCLIPRGN = 26
212Const EMR_MOVETOEX = 27
213Const EMR_SETMETARGN = 28
214Const EMR_EXCLUDECLIPRECT = 29
215Const EMR_INTERSECTCLIPRECT = 30
216Const EMR_SCALEVIEWPORTEXTEX = 31
217Const EMR_SCALEWINDOWEXTEX = 32
218Const EMR_SAVEDC = 33
219Const EMR_RESTOREDC = 34
220Const EMR_SETWORLDTRANSFORM = 35
221Const EMR_MODIFYWORLDTRANSFORM = 36
222Const EMR_SELECTOBJECT = 37
223Const EMR_CREATEPEN = 38
224Const EMR_CREATEBRUSHINDIRECT = 39
225Const EMR_DELETEOBJECT = 40
226Const EMR_ANGLEARC = 41
227Const EMR_ELLIPSE = 42
228Const EMR_RECTANGLE = 43
229Const EMR_ROUNDRECT = 44
230Const EMR_ARC = 45
231Const EMR_CHORD = 46
232Const EMR_PIE = 47
233Const EMR_SELECTPALETTE = 48
234Const EMR_CREATEPALETTE = 49
235Const EMR_SETPALETTEENTRIES = 50
236Const EMR_RESIZEPALETTE = 51
237Const EMR_REALIZEPALETTE = 52
238Const EMR_EXTFLOODFILL = 53
239Const EMR_LINETO = 54
240Const EMR_ARCTO = 55
241Const EMR_POLYDRAW = 56
242Const EMR_SETARCDIRECTION = 57
243Const EMR_SETMITERLIMIT = 58
244Const EMR_BEGINPATH = 59
245Const EMR_ENDPATH = 60
246Const EMR_CLOSEFIGURE = 61
247Const EMR_FILLPATH = 62
248Const EMR_STROKEANDFILLPATH = 63
249Const EMR_STROKEPATH = 64
250Const EMR_FLATTENPATH = 65
251Const EMR_WIDENPATH = 66
252Const EMR_SELECTCLIPPATH = 67
253Const EMR_ABORTPATH = 68
254
255Const EMR_GDICOMMENT = 70
256Const EMR_FILLRGN = 71
257Const EMR_FRAMERGN = 72
258Const EMR_INVERTRGN = 73
259Const EMR_PAINTRGN = 74
260Const EMR_EXTSELECTCLIPRGN = 75
261Const EMR_BITBLT = 76
262Const EMR_STRETCHBLT = 77
263Const EMR_MASKBLT = 78
264Const EMR_PLGBLT = 79
265Const EMR_SETDIBITSTODEVICE = 80
266Const EMR_STRETCHDIBITS = 81
267Const EMR_EXTCREATEFONTINDIRECTW = 82
268Const EMR_EXTTEXTOUTA = 83
269Const EMR_EXTTEXTOUTW = 84
270Const EMR_POLYBEZIER16 = 85
271Const EMR_POLYGON16 = 86
272Const EMR_POLYLINE16 = 87
273Const EMR_POLYBEZIERTO16 = 88
274Const EMR_POLYLINETO16 = 89
275Const EMR_POLYPOLYLINE16 = 90
276Const EMR_POLYPOLYGON16 = 91
277Const EMR_POLYDRAW16 = 92
278Const EMR_CREATEMONOBRUSH = 93
279Const EMR_CREATEDIBPATTERNBRUSHPT = 94
280Const EMR_EXTCREATEPEN = 95
281Const EMR_POLYTEXTOUTA = 96
282Const EMR_POLYTEXTOUTW = 97
283'#if WINVER >= &h0400
284Const EMR_SETICMMODE = 98
285Const EMR_CREATECOLORSPACE = 99
286Const EMR_SETCOLORSPACE = 100
287Const EMR_DELETECOLORSPACE = 101
288Const EMR_GLSRECORD = 102
289Const EMR_GLSBOUNDEDRECORD = 103
290Const EMR_PIXELFORMAT = 104
291'#endif
292'#if WINVER >= &h0500
293Const EMR_RESERVED_105 = 105
294Const EMR_RESERVED_106 = 106
295Const EMR_RESERVED_107 = 107
296Const EMR_RESERVED_108 = 108
297Const EMR_RESERVED_109 = 109
298Const EMR_RESERVED_110 = 110
299Const EMR_COLORCORRECTPALETTE = 111
300Const EMR_SETICMPROFILEA = 112
301Const EMR_SETICMPROFILEW = 113
302Const EMR_ALPHABLEND = 114
303Const EMR_SETLAYOUT = 115
304Const EMR_TRANSPARENTBLT = 116
305'#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
306Const EMR_RESERVED_117 = 117
307'#endif
308Const EMR_GRADIENTFILL = 118
309Const EMR_RESERVED_119 = 119
310Const EMR_RESERVED_120 = 120
311Const EMR_COLORMATCHTOTARGETW = 121
312Const EMR_CREATECOLORSPACEW = 122
313'#endif
314
315' RGB Color
316Const RGB(r, g, b) = ((r) As Long) Or (((g) As Long) <<8) Or (((b) As Long) <<16)
317Const PALETTERGB(r, g, b) = (&h02000000 Or RGB(r,g,b))
318Const PALETTEINDEX(i) = ((&h01000000 Or (i) As Word As DWord) As COLORREF)
319
320Const GetRValue(rgb) = (rgb And &hff)
321Const GetGValue(rgb) = ((rgb >> 8) And &hff)
322Const GetBValue(rgb) = ((rgb >> 16) And &hff)
323
324Type RGBQUAD
325 rgbBlue As Byte
326 rgbGreen As Byte
327 rgbRed As Byte
328 rgbReserved As Byte
329End Type
330
331Type Align(1) RGBTRIPLE
332 rgbtBlue As Byte
333 rgbtGreen As Byte
334 rgbtRed As Byte
335End Type
336
337' CMYK Color
338Const GetKValue(cmyk) = ((cmyk) As Byte)
339Const GetYValue(cmyk) = (((cmyk) >> 8) As Byte)
340Const GetMValue(cmyk) = (((cmyk) >> 16) As Byte)
341Const GetCValue(cmyk) = (((cmyk) >> 24) As Byte)
342
343Const CMYK(c, m, y, k) = (( _
344 ((k) As Byte) Or _
345 ((y) As Byte As Word << 8) Or _
346 ((m) As Byte As DWord << 16) Or _
347 ((c) As Byte As DWord << 24)) As COLORREF)
348
349' ICM Color
350TypeDef FXPT16DOT16 = Long
351TypeDef FXPT2DOT30 = Long
352
353TypeDef LCSCSTYPE = Long
354TypeDef LCSGAMUTMATCH = Long
355
356Type LOGCOLORSPACEA
357 lcsSignature As DWord
358 lcsVersion As DWord
359 lcsSize As DWord
360 lcsCSType As LCSCSTYPE
361 lcsIntent As LCSGAMUTMATCH
362 lcsEndpoints As CIEXYZTRIPLE
363 lcsGammaRed As DWord
364 lcsGammaGreen As DWord
365 lcsGammaBlue As DWord
366 lcsFilename[MAX_PATH] As SByte
367End Type
368Type LOGCOLORSPACEW
369 lcsSignature As DWord
370 lcsVersion As DWord
371 lcsSize As DWord
372 lcsCSType As LCSCSTYPE
373 lcsIntent As LCSGAMUTMATCH
374 lcsEndpoints As CIEXYZTRIPLE
375 lcsGammaRed As DWord
376 lcsGammaGreen As DWord
377 lcsGammaBlue As DWord
378 lcsFilename[ELM(MAX_PATH)] As WCHAR
379End Type
380#ifdef UNICODE
381TypeDef LOGCOLORSPACE = LOGCOLORSPACEW
382#else
383TypeDef LOGCOLORSPACE = LOGCOLORSPACEA
384#endif
385
386Type CIEXYZ
387 ciexyzX As FXPT2DOT30
388 ciexyzY As FXPT2DOT30
389 ciexyzZ As FXPT2DOT30
390End Type
391
392Type CIEXYZTRIPLE
393 ciexyzRed As CIEXYZ
394 ciexyzGreen As CIEXYZ
395 ciexyzBlue As CIEXYZ
396End Type
397
398Type LOGPALETTE
399 palVersion As Word
400 palNumEntries As Word
401 palPalEntry[ELM(1)] As PALETTEENTRY
402End Type
403
404' raster operations
405Const SRCCOPY = &H00CC0020
406Const SRCPAINT = &H00EE0086
407Const SRCAND = &H008800C6
408Const SRCINVERT = &H00660046
409Const SRCERASE = &H00440328
410Const NOTSRCCOPY = &H00330008
411Const NOTSRCERASE = &H001100A6
412Const MERGECOPY = &H00C000CA
413Const MERGEPAINT = &H00BB0226
414Const PATCOPY = &H00F00021
415Const PATPAINT = &H00FB0A09
416Const PATINVERT = &H005A0049
417Const DSTINVERT = &H00550009
418Const BLACKNESS = &H00000042
419Const WHITENESS = &H00FF0062
420
421
422' Object types
423Const OBJ_PEN = 1
424Const OBJ_BRUSH = 2
425Const OBJ_DC = 3
426Const OBJ_METADC = 4
427Const OBJ_PAL = 5
428Const OBJ_FONT = 6
429Const OBJ_BITMAP = 7
430Const OBJ_REGION = 8
431Const OBJ_METAFILE = 9
432Const OBJ_MEMDC = 10
433Const OBJ_EXTPEN = 11
434Const OBJ_ENHMETADC = 12
435Const OBJ_ENHMETAFILE = 13
436
437
438' Bitmap Header Definition
439Type BITMAP
440 bmType As Long
441 bmWidth As Long
442 bmHeight As Long
443 bmWidthBytes As Long
444 bmPlanes As Word
445 bmBitsPixel As Word
446 bmBits As VoidPtr
447End Type
448
449Type BITMAPCOREHEADER
450 bcSize As DWord
451 bcWidth As Word
452 bcHeight As Word
453 bcPlanes As Word
454 bcBitCount As Word
455End Type
456
457Type BITMAPCOREINFO
458 bmciHeader As BITMAPCOREHEADER
459 bmciColors[ELM(1)] As RGBTRIPLE
460End Type
461
462' structures for defining DIBs
463Const BI_RGB = 0
464Const BI_RLE8 = 1
465Const BI_RLE4 = 2
466Const BI_BITFIELDS = 3
467Const BI_JPEG = 4
468Const BI_PNG = 5
469
470Type BITMAPINFOHEADER
471 biSize As DWord
472 biWidth As Long
473 biHeight As Long
474 biPlanes As Word
475 biBitCount As Word
476 biCompression As DWord
477 biSizeImage As DWord
478 biXPelsPerMeter As Long
479 biYPelsPerMeter As Long
480 biClrUsed As DWord
481 biClrImportant As DWord
482End Type
483
484Type BITMAPINFO
485 bmiHeader As BITMAPINFOHEADER
486 bmiColors[ELM(1)] As RGBQUAD '以前はbmpColors[255] As RGBQUADだったことに注意
487End Type
488
489
490' Bitmap file header struct
491Type Align(2) BITMAPFILEHEADER
492 bfType As Word
493 bfSize As DWord
494 bfReserved1 As Word
495 bfReserved2 As Word
496 bfOffBits As DWord
497End Type
498
499Type BITMAPV4HEADER
500 bV4Size As DWord
501 bV4Width As Long
502 bV4Height As Long
503 bV4Planes As Word
504 bV4BitCount As Word
505 bV4V4Compression As DWord
506 bV4SizeImage As DWord
507 bV4XPelsPerMeter As Long
508 bV4YPelsPerMeter As Long
509 bV4ClrUsed As DWord
510 bV4ClrImportant As DWord
511 bV4RedMask As DWord
512 bV4GreenMask As DWord
513 bV4BlueMask As DWord
514 bV4AlphaMask As DWord
515 bV4CSType As DWord
516 bV4Endpoints As CIEXYZTRIPLE
517 bV4GammaRed As DWord
518 bV4GammaGreen As DWord
519 bV4GammaBlue As DWord
520End Type
521
522' Region flags
523Const NULLREGION = 1
524Const SIMPLEREGION = 2
525Const COMPLEXREGION = 3
526
527
528' Poly fill mode
529Const ALTERNATE = 1
530Const WINDING = 2
531
532
533' Device mode
534Const DM_ORIENTATION = &H00000001
535Const DM_PAPERSIZE = &H00000002
536Const DM_PAPERLENGTH = &H00000004
537Const DM_PAPERWIDTH = &H00000008
538Const DM_SCALE = &H00000010
539Const DM_POSITION = &H00000020
540Const DM_COPIES = &H00000100
541Const DM_DEFAULTSOURCE = &H00000200
542Const DM_PRINTQUALITY = &H00000400
543Const DM_COLOR = &H00000800
544Const DM_DUPLEX = &H00001000
545Const DM_YRESOLUTION = &H00002000
546Const DM_TTOPTION = &H00004000
547Const DM_COLLATE = &H00008000
548Const DM_FORMNAME = &H00010000
549Const DM_LOGPIXELS = &H00020000
550Const DM_BITSPERPEL = &H00040000
551Const DM_PELSWIDTH = &H00080000
552Const DM_PELSHEIGHT = &H00100000
553Const DM_DISPLAYFLAGS = &H00200000
554Const DM_DISPLAYFREQUENCY = &H00400000
555Const DMORIENT_PORTRAIT = 1
556Const DMORIENT_LANDSCAPE = 2
557Const DMPAPER_LETTER = 1
558Const DMPAPER_LETTERSMALL = 2
559Const DMPAPER_TABLOID = 3
560Const DMPAPER_LEDGER = 4
561Const DMPAPER_LEGAL = 5
562Const DMPAPER_STATEMENT = 6
563Const DMPAPER_EXECUTIVE = 7
564Const DMPAPER_A3 = 8
565Const DMPAPER_A4 = 9
566Const DMPAPER_A4SMALL = 10
567Const DMPAPER_A5 = 11
568Const DMPAPER_B4 = 12
569Const DMPAPER_B5 = 13
570Const DMPAPER_FOLIO = 14
571Const DMPAPER_QUARTO = 15
572Const DMPAPER_10X14 = 16
573Const DMPAPER_11X17 = 17
574Const DMPAPER_NOTE = 18
575Const DMPAPER_ENV_9 = 19
576Const DMPAPER_ENV_10 = 20
577Const DMPAPER_ENV_11 = 21
578Const DMPAPER_ENV_12 = 22
579Const DMPAPER_ENV_14 = 23
580Const DMPAPER_CSHEET = 24
581Const DMPAPER_DSHEET = 25
582Const DMPAPER_ESHEET = 26
583Const DMPAPER_ENV_DL = 27
584Const DMPAPER_ENV_C5 = 28
585Const DMPAPER_ENV_C3 = 29
586Const DMPAPER_ENV_C4 = 30
587Const DMPAPER_ENV_C6 = 31
588Const DMPAPER_ENV_C65 = 32
589Const DMPAPER_ENV_B4 = 33
590Const DMPAPER_ENV_B5 = 34
591Const DMPAPER_ENV_B6 = 35
592Const DMPAPER_ENV_ITALY = 36
593Const DMPAPER_ENV_MONARCH = 37
594Const DMPAPER_ENV_PERSONAL = 38
595Const DMPAPER_FANFOLD_US = 39
596Const DMPAPER_FANFOLD_STD_GERMAN = 40
597Const DMPAPER_FANFOLD_LGL_GERMAN = 41
598Const DMRES_DRAFT = -1
599Const DMRES_LOW = -2
600Const DMRES_MEDIUM = -3
601Const DMRES_HIGH = -4
602Const DMCOLOR_MONOCHROME = 1
603Const DMCOLOR_COLOR = 2
604Const DMDUP_SIMPLEX = 1
605Const DMDUP_VERTICAL = 2
606Const DMDUP_HORIZONTAL = 3
607Const DMTT_BITMAP = 1
608Const DMTT_DOWNLOAD = 2
609Const DMTT_SUBDEV = 3
610Const DMCOLLATE_FALSE = 0
611Const DMCOLLATE_TRUE = 1
612
613Const CCHFORMNAME = 32
614Type DEVMODEW
615 dmDeviceName[ELM(CCHDEVICENAME)] As WCHAR
616 dmSpecVersion As Word
617 dmDriverVersion As Word
618 dmSize As Word
619 dmDriverExtra As Word
620 dmFields As DWord
621 dmOrientation As Integer
622 dmPaperSize As Integer
623 dmPaperLength As Integer
624 dmPaperWidth As Integer
625 dmScale As Integer
626 dmCopies As Integer
627 dmDefaultSource As Integer
628 dmPrintQuality As Integer
629 dmColor As Integer
630 dmDuplex As Integer
631 dmYResolution As Integer
632 dmTTOption As Integer
633 dmCollate As Integer
634 dmFormName[ELM(CCHFORMNAME)] As WCHAR
635 dmLogPixels As Word
636 dmBitsPerPel As DWord
637 dmPelsWidth As DWord
638 dmPelsHeight As DWord
639 dmDisplayFlags As DWord
640 dmDisplayFrequency As DWord
641 dmICMMethod As DWord
642 dmICMIntent As DWord
643 dmMediaType As DWord
644 dmDitherType As DWord
645 dmReserved1 As DWord
646 dmReserved2 As DWord
647 dmPanningWidth As DWord
648 dmPanningHeight As DWord
649End Type
650Type DEVMODEA
651 dmDeviceName[ELM(CCHDEVICENAME)] As SByte
652 dmSpecVersion As Word
653 dmDriverVersion As Word
654 dmSize As Word
655 dmDriverExtra As Word
656 dmFields As DWord
657 dmOrientation As Integer
658 dmPaperSize As Integer
659 dmPaperLength As Integer
660 dmPaperWidth As Integer
661 dmScale As Integer
662 dmCopies As Integer
663 dmDefaultSource As Integer
664 dmPrintQuality As Integer
665 dmColor As Integer
666 dmDuplex As Integer
667 dmYResolution As Integer
668 dmTTOption As Integer
669 dmCollate As Integer
670 dmFormName[ELM(CCHFORMNAME)] As SByte
671 dmLogPixels As Word
672 dmBitsPerPel As DWord
673 dmPelsWidth As DWord
674 dmPelsHeight As DWord
675 dmDisplayFlags As DWord
676 dmDisplayFrequency As DWord
677 dmICMMethod As DWord
678 dmICMIntent As DWord
679 dmMediaType As DWord
680 dmDitherType As DWord
681 dmReserved1 As DWord
682 dmReserved2 As DWord
683 dmPanningWidth As DWord
684 dmPanningHeight As DWord
685End Type
686#ifdef UNICODE
687TypeDef DEVMODE = DEVMODEW
688#else
689TypeDef DEVMODE = DEVMODEA
690#endif
691
692' Binary raster ops
693Const R2_BLACK = 1
694Const R2_NOTMERGEPEN = 2
695Const R2_MASKNOTPEN = 3
696Const R2_NOTCOPYPEN = 4
697Const R2_MASKPENNOT = 5
698Const R2_NOT = 6
699Const R2_XORPEN = 7
700Const R2_NOTMASKPEN = 8
701Const R2_MASKPEN = 9
702Const R2_NOTXORPEN = 10
703Const R2_NOP = 11
704Const R2_MERGENOTPEN = 12
705Const R2_COPYPEN = 13
706Const R2_MERGEPENNOT = 14
707Const R2_MERGEPEN = 15
708Const R2_WHITE = 16
709
710
711Type RGNDATAHEADER
712 dwSize As DWord
713 iType As DWord
714 nCount As DWord
715 nRgnSize As DWord
716 rcBound As RECT
717End Type
718Type RGNDATA
719 rdh As RGNDATAHEADER
720 Buffer As Byte
721End Type
722
723Type PALETTEENTRY
724 peRed As Byte
725 peGreen As Byte
726 peBlue As Byte
727 peFlags As Byte
728End Type
729
730Type DOCINFOW
731 cbSize As Long
732 lpszDocName As LPCWSTR
733 lpszOutput As LPCWSTR
734 lpszDatatype As LPCWSTR
735 fwType As DWord
736End Type
737Type DOCINFOA
738 cbSize As Long
739 lpszDocName As LPCSTR
740 lpszOutput As LPCSTR
741 lpszDatatype As LPCSTR
742 fwType As DWord
743End Type
744#ifdef UNICODE
745TypeDef DOCINFO = DOCINFOW
746#else
747TypeDef DOCINFO = DOCINFOA
748#endif
749
750'-------------------
751' GDI API Functions
752'-------------------
753
754Declare Function AbortPath Lib "gdi32" (hdc As HDC) As BOOL
755Type BLENDFUNCTION
756 BlendOp As Byte
757 BlendFlags As Byte
758 SourceConstantAlpha As Byte
759 AlphaFormat As Byte
760End Type
761Declare Function AlphaBlend Lib "msimg32" (hdcDest As HDC, nXDest As Long, nYDest As Long, nDestWidth As Long, nDestHeight As Long, hdcSrc As HDC, XSrc As Long, YSrc As Long, nSrcWidth As Long, nSrcHeight As Long, ByRef blendfunc As BLENDFUNCTION) As Long
762Declare Function Arc Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nXStartArc As Long, nYStartArc As Long, nXEndArc As Long, nYEndArc As Long) As BOOL
763Declare Function BeginPath Lib "gdi32" (hdc As HDC) As BOOL
764Declare Function BitBlt Lib "gdi32" (hdcDest As HDC, nXDest As Long, nYDest As Long, nWidth As Long, nHeight As Long, hdcSrc As HDC, nXSrc As Long, nYSrc As Long, dwRop As DWord) As BOOL
765Declare Function CancelDC Lib "gdi32" (hdc As HDC) As BOOL
766Declare Function Chord Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nXRadial1 As Long, nYRadial1 As Long, nXRadial2 As Long, nYRadial2 As Long) As BOOL
767Declare Function CloseEnhMetaFile Lib "gdi32" (hdc As HDC) As HENHMETAFILE
768Declare Function CloseFigure Lib "gdi32" (hdc As HDC) As BOOL
769Declare Function CloseMetaFile Lib "gdi32" (hdc As HDC) As HMETAFILE
770
771Const RGN_AND = 1
772Const RGN_OR = 2
773Const RGN_XOR = 3
774Const RGN_DIFF = 4
775Const RGN_COPY = 5
776Declare Function CombineRgn Lib "gdi32" (hrgnDest As HRGN, hrgnSrc1 As HRGN, hrgnSrc2 As HRGN, fnCombineMode As Long) As Long
777Declare Function CopyEnhMetaFile Lib "gdi32" Alias _FuncName_CopyEnhMetaFile (hemfSrc As HENHMETAFILE, pszFile As PCTSTR) As HENHMETAFILE
778Declare Function CopyMetaFile Lib "gdi32" Alias _FuncName_CopyMetaFile (hmfSrc As HMETAFILE, pszFile As PCTSTR) As HMETAFILE
779Declare Function CreateBitmap Lib "gdi32" (nWidth As Long, nHeight As Long, cPlanes As Long, cBitsPerPel As Long, lpvBits As VoidPtr) As HBITMAP
780Declare Function CreateBitmapIndirect Lib "gdi32" (ByRef bm As BITMAP) As HBITMAP
781
782Const BS_SOLID = 0
783Const BS_NULL = 1
784Const BS_HOLLOW = BS_NULL
785Const BS_HATCHED = 2
786Const BS_PATTERN = 3
787Const BS_INDEXED = 4
788Const BS_DIBPATTERN = 5
789Const BS_DIBPATTERNPT = 6
790Const BS_PATTERN8X8 = 7
791Const BS_DIBPATTERN8X8 = 8
792Const BS_MONOPATTERN = 9
793Const DIB_RGB_COLORS = 0
794Const DIB_PAL_COLORS = 1
795Const HS_HORIZONTAL = 0
796Const HS_VERTICAL = 1
797Const HS_FDIAGONAL = 2
798Const HS_BDIAGONAL = 3
799Const HS_CROSS = 4
800Const HS_DIAGCROSS = 5
801Type LOGBRUSH
802 lbStyle As Long
803 lbColor As Long
804 lbHatch As Long
805End Type
806Declare Function CreateBrushIndirect Lib "gdi32" (ByRef lplb As LOGBRUSH) As HBRUSH
807
808Declare Function CreateCompatibleBitmap Lib "gdi32" (hdc As HDC, nWidth As Long, nHeight As Long) As HBITMAP
809Declare Function CreateCompatibleDC Lib "gdi32" (hdc As HDC) As HDC
810Declare Function CreateDC Lib "gdi32" Alias _FuncName_CreateDC (pszDriver As PCTSTR, pszDevice As PCTSTR, pszOutput As PCTSTR, ByRef InitData As DEVMODE) As HDC
811
812Const CBM_INIT = &H04
813Declare Function CreateDIBitmap Lib "gdi32" (hdc As HDC, ByRef bmih As BITMAPINFOHEADER, fdwInit As Long, lpbInit As VoidPtr, ByRef bmi As BITMAPINFO, fuUsage As Long) As HBITMAP
814
815Declare Function CreateDIBPatternBrushPt Lib "gdi32" (lpPackedDIB As VoidPtr, iUsage As Long) As HBRUSH
816Declare Function CreateDIBSection Lib "gdi32" (hdc As HDC, ByRef BmpInfo As BITMAPINFO, iUsage As DWord, ppvBits As *VoidPtr, hSection As HANDLE, dwOffset As DWord) As HBITMAP
817Declare Function CreateEllipticRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN
818Declare Function CreateEllipticRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN
819Declare Function CreateEnhMetaFile Lib "gdi32" Alias _FuncName_CreateEnhMetaFile (hdcRef As HDC, pFileName As PCTSTR, ByRef Rect As RECT, pDescription As PCTSTR) As HDC
820Declare Function CreateMetaFile Lib "gdi32" Alias _FuncName_CreateMetaFile (pFileName As PCTSTR) As HDC
821
822Const FW_DONTCARE = 0
823Const FW_THIN = 100
824Const FW_EXTRALIGHT = 200
825Const FW_LIGHT = 300
826Const FW_NORMAL = 400
827Const FW_MEDIUM = 500
828Const FW_SEMIBOLD = 600
829Const FW_BOLD = 700
830Const FW_EXTRABOLD = 800
831Const FW_HEAVY = 900
832Const FW_ULTRALIGHT = FW_EXTRALIGHT
833Const FW_REGULAR = FW_NORMAL
834Const FW_DEMIBOLD = FW_SEMIBOLD
835Const FW_ULTRABOLD = FW_EXTRABOLD
836Const FW_BLACK = FW_HEAVY
837
838Const ANSI_CHARSET = 0
839Const DEFAULT_CHARSET = 1
840Const SYMBOL_CHARSET = 2
841Const SHIFTJIS_CHARSET = 128
842Const HANGEUL_CHARSET = 129
843Const HANGUL_CHARSET = 129
844Const GB2312_CHARSET = 134
845Const CHINESEBIG5_CHARSET = 136
846Const OEM_CHARSET = 255
847Const JOHAB_CHARSET = 130
848Const HEBREW_CHARSET = 177
849Const ARABIC_CHARSET = 178
850Const GREEK_CHARSET = 161
851Const TURKISH_CHARSET = 162
852Const VIETNAMESE_CHARSET = 163
853Const THAI_CHARSET = 222
854Const EASTEUROPE_CHARSET = 238
855Const RUSSIAN_CHARSET = 204
856Const MAC_CHARSET = 77
857Const BALTIC_CHARSET = 186
858
859Const OUT_DEFAULT_PRECIS = 0
860Const OUT_STRING_PRECIS = 1
861Const OUT_CHARACTER_PRECIS = 2
862Const OUT_STROKE_PRECIS = 3
863Const OUT_TT_PRECIS = 4
864Const OUT_DEVICE_PRECIS = 5
865Const OUT_RASTER_PRECIS = 6
866Const OUT_TT_ONLY_PRECIS = 7
867Const OUT_OUTLINE_PRECIS = 8
868Const OUT_SCREEN_OUTLINE_PRECIS = 9
869
870Const CLIP_DEFAULT_PRECIS = 0
871Const CLIP_CHARACTER_PRECIS = 1
872Const CLIP_STROKE_PRECIS = 2
873Const CLIP_MASK = &Hf
874Const CLIP_LH_ANGLES = &H00010000
875Const CLIP_TT_ALWAYS = &H00020000
876Const CLIP_EMBEDDED = &H00080000
877
878Const DEFAULT_QUALITY = 0
879Const DRAFT_QUALITY = 1
880Const PROOF_QUALITY = 2
881Const NONANTIALIASED_QUALITY =3
882Const ANTIALIASED_QUALITY = 4
883
884Const DEFAULT_PITCH = 0
885Const FIXED_PITCH = 1
886Const VARIABLE_PITCH = 2
887
888Const FF_DONTCARE = 0
889Const FF_ROMAN = &H00010000
890Const FF_SWISS = &H00020000
891Const FF_MODERN = &H00030000
892Const FF_SCRIPT = &H00040000
893Const FF_DECORATIVE = &H00050000
894Declare Function CreateFont Lib "gdi32" Alias _FuncName_CreateFont (nHeight As Long, nWidth As Long, nEscapement As Long, nOrientation As Long, fnWeight As Long, fdwItalic As DWord, fdwUnderline As DWord, fdwStrikeOut As DWord, fdwCharSet As DWord, fdwOutputPrecision As DWord, fdwClipPrecision As DWord, fdwQuality As DWord, fdwPitchAndFamily As DWord, lpszFace As PCTSTR) As HFONT
895
896Const LF_FACESIZE = 32
897Type LOGFONTA
898 lfHeight As Long
899 lfWidth As Long
900 lfEscapement As Long
901 lfOrientation As Long
902 lfWeight As Long
903 lfItalic As Byte
904 lfUnderline As Byte
905 lfStrikeOut As Byte
906 lfCharSet As Byte
907 lfOutPrecision As Byte
908 lfClipPrecision As Byte
909 lfQuality As Byte
910 lfPitchAndFamily As Byte
911 lfFaceName[ELM(LF_FACESIZE)] As SByte
912End Type
913Type LOGFONTW
914 lfHeight As Long
915 lfWidth As Long
916 lfEscapement As Long
917 lfOrientation As Long
918 lfWeight As Long
919 lfItalic As Byte
920 lfUnderline As Byte
921 lfStrikeOut As Byte
922 lfCharSet As Byte
923 lfOutPrecision As Byte
924 lfClipPrecision As Byte
925 lfQuality As Byte
926 lfPitchAndFamily As Byte
927 lfFaceName[ELM(LF_FACESIZE)] As WCHAR
928End Type
929#ifdef UNICODE
930TypeDef LOGFONT = LOGFONTW
931#else
932TypeDef LOGFONT = LOGFONTA
933#endif
934Declare Function CreateFontIndirectA Lib "gdi32" (ByRef lf As LOGFONTA) As HFONT
935Declare Function CreateFontIndirect Lib "gdi32" Alias _FuncName_CreateFontIndirect (ByRef lf As LOGFONT) As HFONT
936
937Declare Function CreateHatchBrush Lib "gdi32" (fnStyle As Long, clrref As COLORREF) As HBRUSH
938Declare Function CreatePatternBrush Lib "gdi32" (hbmp As HBITMAP) As HBRUSH
939Declare Function CreatePalette Lib "gdi32" (lplgpl As *LOGPALETTE) As HPALETTE
940
941Const PS_SOLID = 0
942Const PS_DASH = 1
943Const PS_DOT = 2
944Const PS_DASHDOT = 3
945Const PS_DASHDOTDOT = 4
946Const PS_NULL = 5
947Const PS_INSIDEFRAME = 6
948Const PS_USERSTYLE = 7
949Const PS_ALTERNATE = 8
950Declare Function CreatePen Lib "gdi32" (nPenStyle As Long, nWidth As Long, crColor As COLORREF) As HPEN
951
952Type LOGPEN
953 lopnStyle As DWord
954 lopnWidth As POINTAPI
955 lopnColor As COLORREF
956End Type
957Declare Function CreatePenIndirect Lib "gdi32" (ByRef lplgpn As LOGPEN) As HPEN
958
959Declare Function CreatePolygonRgn Lib "gdi32" (ByRef lpPoints As POINTAPI, cPoints As Long, fnPolyFillMode As Long) As HRGN
960Declare Function CreateRectRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN
961Declare Function CreateRectRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN
962Declare Function CreateRoundRectRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nWidthEllipse As Long, nHeightEllipse As Long) As HRGN
963Declare Function CreateSolidBrush Lib "gdi32" (crColor As COLORREF) As HBRUSH
964Declare Function DeleteDC Lib "gdi32" (hdc As HDC) As BOOL
965Declare Function DeleteEnhMetaFile Lib "gdi32" (hemf As HENHMETAFILE) As BOOL
966Declare Function DeleteMetaFile Lib "gdi32" (hmf As HMETAFILE) As BOOL
967Declare Function DeleteObject Lib "gdi32" (hObject As HANDLE) As BOOL
968Declare Function DPtoLP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As BOOL
969Declare Function Ellipse Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, RightRect As Long, nBottomRect As Long) As BOOL
970Declare Function EndDoc Lib "gdi32" (hdc As HDC) As Long
971Declare Function EndPage Lib "gdi32" (hdc As HDC) As Long
972Declare Function EndPath Lib "gdi32" (hdc As HDC) As BOOL
973Declare Function EnumEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, pEnhMetaFunc As ENHMFENUMPROC, pData As VoidPtr, ByRef Rect As RECT) As BOOL
974Declare Function EnumMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE, pMetaFunc As MFENUMPROC, lParam As LPARAM) As BOOL
975Declare Function EqualRgn Lib "gdi32" (hSrcRgn1 As HRGN, hSrcRgn2 As HRGN) As BOOL
976Declare Function ExcludeClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
977
978Const FLOODFILLBORDER = 0
979Const FLOODFILLSURFACE = 1
980Declare Function ExtFloodFill Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, crColor As COLORREF, fuFillType As DWord) As BOOL
981
982Const PS_COSMETIC = &H00000000
983Const PS_GEOMETRIC = &H00010000
984Const PS_ENDCAP_ROUND = &H00000000
985Const PS_ENDCAP_SQUARE = &H00000100
986Const PS_ENDCAP_FLAT = &H00000200
987Const PS_JOIN_ROUND = &H00000000
988Const PS_JOIN_BEVEL = &H00001000
989Const PS_JOIN_MITER = &H00002000
990Declare Function ExtCreatePen Lib "gdi32" (dwPenStyle As DWord, dwWidth As DWord, ByRef lplb As LOGBRUSH, dwStyleCount As DWord, lpStyle As *DWord) As HPEN
991
992Declare Function ExtSelectClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, fnMode As Long) As Long
993Const ETO_OPAQUE = &h0002
994Const ETO_CLIPPED = &h0004
995'#if WINVER >= &h0400
996Const ETO_GLYPH_INDEX = &h0010
997Const ETO_RTLREADING = &h0080
998Const ETO_NUMERICSLOCAL = &h0400
999Const ETO_NUMERICSLATIN = &h0800
1000Const ETO_IGNORELANGUAGE = &h1000
1001'#endif
1002'#if _WIN32_WINNT >= &h0500
1003'Const ETO_PDY = &h2000
1004'#endif
1005'#if _WIN32_WINNT >= &h0600
1006'Const ETO_REVERSE_INDEX_MAP = &h10000
1007'#endif
1008Declare Function ExtTextOutA Lib "gdi32" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, lpString As PCSTR, cbCount As Long, pDx As *Long) As Long
1009Declare Function ExtTextOutW Lib "gdi32" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, lpString As PCWSTR, cbCount As Long, pDx As *Long) As Long
1010#ifdef UNICODE
1011Declare Function ExtTextOut Lib "gdi32" Alias "ExtTextOutW" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, pString As PCWSTR, cbCount As Long, pDx As *Long) As Long
1012#else
1013Declare Function ExtTextOut Lib "gdi32" Alias "ExtTextOutA" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, pString As PCSTR, cbCount As Long, pDx As *Long) As Long
1014#endif
1015Declare Function FillPath Lib "gdi32" (hdc As HDC) As Long
1016Declare Function FillRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH) As Long
1017Declare Function FrameRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH, nWidth As Long, nHeight As Long) As Long
1018Declare Function GdiComment Lib "gdi32" (hdc As HDC, cbSize As DWord, lpData As *Byte) As BOOL
1019Declare Function GdiFlush Lib "gdi32" () As BOOL
1020Declare Function GetBitmapBits Lib "gdi32" (hbmp As HBITMAP, cbBuffer As Long, lpvBits As VoidPtr) As Long
1021Declare Function GetBkColor Lib "gdi32" (hdc As HDC) As DWord
1022Declare Function GetBkMode Lib "gdi32" (hdc As HDC) As Long
1023Declare Function GetBrushOrgEx Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI) As Long
1024' only WinNT
1025'Declare Function GetCharWidth32 Lib "gdi32" Alias "GetCharWidth32A" (hdc As HDC, iFirstChar As DWord, iLastChar As DWord, pBuffer As *DWord) As Long
1026Declare Function GetClipBox Lib "gdi32" (hdc As HDC, ByRef lpRect As RECT) As Long
1027Declare Function GetClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1028Declare Function GetCurrentObject Lib "gdi32" (hdc As HDC, dwObjectType As DWord) As HANDLE
1029Declare Function GetCurrentPositionEx Lib "gdi32" (hdc As HDC, ByRef Point As POINTAPI) As Long
1030
1031Const DRIVERVERSION = 0
1032Const TECHNOLOGY = 2
1033Const HORZSIZE = 4
1034Const VERTSIZE = 6
1035Const HORZRES = 8
1036Const VERTRES = 10
1037Const BITSPIXEL = 12
1038Const PLANES = 14
1039Const NUMBRUSHES = 16
1040Const NUMPENS = 18
1041Const NUMMARKERS = 20
1042Const NUMFONTS = 22
1043Const NUMCOLORS = 24
1044Const PDEVICESIZE = 26
1045Const CURVECAPS = 28
1046Const LINECAPS = 30
1047Const POLYGONALCAPS = 32
1048Const TEXTCAPS = 34
1049Const CLIPCAPS = 36
1050Const RASTERCAPS = 38
1051Const ASPECTX = 40
1052Const ASPECTY = 42
1053Const ASPECTXY = 44
1054Const SHADEBLENDCAPS = 45
1055Const LOGPIXELSX = 88
1056Const LOGPIXELSY = 90
1057Const SIZEPALETTE = 104
1058Const NUMRESERVED = 106
1059Const COLORRES = 108
1060Const PHYSICALWIDTH = 110
1061Const PHYSICALHEIGHT = 111
1062Const PHYSICALOFFSETX = 112
1063Const PHYSICALOFFSETY = 113
1064Const SCALINGFACTORX = 114
1065Const SCALINGFACTORY = 115
1066Const VREFRESH = 116
1067Const DESKTOPVERTRES = 117
1068Const DESKTOPHORZRES = 118
1069Const BLTALIGNMENT = 119
1070Const DT_PLOTTER = 0 ' Device Technologies
1071Const DT_RASDISPLAY = 1
1072Const DT_RASPRINTER = 2
1073Const DT_RASCAMERA = 3
1074Const DT_CHARSTREAM = 4
1075Const DT_METAFILE = 5
1076Const DT_DISPFILE = 6
1077Const CC_NONE = 0 ' Curve Capabilities
1078Const CC_CIRCLES = 1
1079Const CC_PIE = 2
1080Const CC_CHORD = 4
1081Const CC_ELLIPSES = 8
1082Const CC_WIDE = 16
1083Const CC_STYLED = 32
1084Const CC_WIDESTYLED = 64
1085Const CC_INTERIORS = 128
1086Const CC_ROUNDRECT = 256
1087Const LC_NONE = 0 ' Line Capabilities
1088Const LC_POLYLINE = 2
1089Const LC_MARKER = 4
1090Const LC_POLYMARKER = 8
1091Const LC_WIDE = 16
1092Const LC_STYLED = 32
1093Const LC_WIDESTYLED = 64
1094Const LC_INTERIORS = 128
1095Const PC_NONE = 0 ' Polygonal Capabilities
1096Const PC_POLYGON = 1
1097Const PC_RECTANGLE = 2
1098Const PC_WINDPOLYGON = 4
1099Const PC_TRAPEZOID = 4
1100Const PC_SCANLINE = 8
1101Const PC_WIDE = 16
1102Const PC_STYLED = 32
1103Const PC_WIDESTYLED = 64
1104Const PC_INTERIORS = 128
1105Const PC_POLYPOLYGON = 256
1106Const PC_PATHS = 512
1107Const CP_NONE = 0 ' Clipping Capabilities
1108Const CP_RECTANGLE = 1
1109Const CP_REGION = 2
1110Const TC_OP_CHARACTER = &H00000001 ' Text Capabilities
1111Const TC_OP_STROKE = &H00000002
1112Const TC_CP_STROKE = &H00000004
1113Const TC_CR_90 = &H00000008
1114Const TC_CR_ANY = &H00000010
1115Const TC_SF_X_YINDEP = &H00000020
1116Const TC_SA_DOUBLE = &H00000040
1117Const TC_SA_INTEGER = &H00000080
1118Const TC_SA_CONTIN = &H00000100
1119Const TC_EA_DOUBLE = &H00000200
1120Const TC_IA_ABLE = &H00000400
1121Const TC_UA_ABLE = &H00000800
1122Const TC_SO_ABLE = &H00001000
1123Const TC_RA_ABLE = &H00002000
1124Const TC_VA_ABLE = &H00004000
1125Const TC_RESERVED = &H00008000
1126Const TC_SCROLLBLT = &H00010000
1127Const RC_BITBLT = 1 ' Raster Capabilities
1128Const RC_BANDING = 2
1129Const RC_SCALING = 4
1130Const RC_BITMAP64 = 8
1131Const RC_GDI20_OUTPUT = &H0010
1132Const RC_GDI20_STATE = &H0020
1133Const RC_SAVEBITMAP = &H0040
1134Const RC_DI_BITMAP = &H0080
1135Const RC_PALETTE = &H0100
1136Const RC_DIBTODEV = &H0200
1137Const RC_BIGFONT = &H0400
1138Const RC_STRETCHBLT = &H0800
1139Const RC_FLOODFILL = &H1000
1140Const RC_STRETCHDIB = &H2000
1141Const RC_OP_DX_OUTPUT = &H4000
1142Const RC_DEVBITS = &H8000
1143Const SB_NONE = &H00000000 ' Shading and blending caps
1144Const SB_CONST_ALPHA = &H00000001
1145Const SB_PIXEL_ALPHA = &H00000002
1146Const SB_PREMULT_ALPHA = &H00000004
1147Const SB_GRAD_RECT = &H00000010
1148Declare Function GetDeviceCaps Lib "gdi32" (hdc As HDC, nIndex As Long) As Long
1149
1150Declare Function GetDIBits Lib "gdi32" (hdc As HDC, hbmp As HBITMAP, uStartScan As DWord, cScanLines As DWord, lpvBits As VoidPtr, ByRef lpbi As BITMAPINFO, uUsage As DWord) As Long
1151Declare Function GetEnhMetaFile Lib "gdi32" Alias _FuncName_GetEnhMetaFile (pszMetaFile As PCTSTR) As HENHMETAFILE
1152Declare Function GetEnhMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte) As DWord
1153Declare Function GetEnhMetaFileDescription Lib "gdi32" Alias _FuncName_GetEnhMetaFileDescription (hemf As HENHMETAFILE, cbBuffer As DWord, pszDescription As PTSTR) As DWord
1154Declare Function GetEnhMetaFileHeader Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, ByRef emh As ENHMETAHEADER) As DWord
1155Declare Function GetEnhMetaFilePaletteEntries Lib "gdi32" (hemf As HENHMETAFILE, cEntries As DWord, ByRef pe As PALETTEENTRY) As DWord
1156
1157Const MM_TEXT = 1
1158Const MM_LOMETRIC = 2
1159Const MM_HIMETRIC = 3
1160Const MM_LOENGLISH = 4
1161Const MM_HIENGLISH = 5
1162Const MM_TWIPS = 6
1163Const MM_ISOTROPIC = 7
1164Const MM_ANISOTROPIC = 8
1165Declare Function GetMapMode Lib "gdi32" (hdc As HDC) As Long
1166Declare Function GetMetaFileBitsEx Lib "gdi32" (hmf As HMETAFILE, nSize As DWord, pvData As VoidPtr) As DWord
1167Declare Function GetMiterLimit Lib "gdi32" (hdc As HDC, peLimit As SinglePtr) As Long
1168Declare Function GetObjectA Lib "gdi32" (hgdiobj As HANDLE, cbBuffer As Long, ByRef pvObject As Any) As Long
1169Declare Function GetObjectW Lib "gdi32" (hgdiobj As HANDLE, cbBuffer As Long, ByRef pvObject As Any) As Long
1170Declare Function GetObject Lib "gdi32" Alias _FuncName_GetObject (hgdiobj As HANDLE, cbBuffer As Long, ByRef pvObject As Any) As Long
1171Declare Function GetObjectType Lib "gdi32" (hObject As HANDLE) As Long
1172
1173Const PT_CLOSEFIGURE = &H01
1174Const PT_LINETO = &H02
1175Const PT_BEZIERTO = &H04
1176Const PT_MOVETO = &H06
1177Declare Function GetPath Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, lpTypes As BytePtr, nSize As Long) As Long
1178
1179Declare Function GetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long) As DWord
1180Declare Function GetPolyFillMode Lib "gdi32" (hdc As HDC) As Long
1181Declare Function GetRgnBox Lib "gdi32" (hRgn As HRGN, ByRef lpRect As RECT) As Long
1182Declare Function GetROP2 Lib "gdi32" (hdc As HDC) As Long
1183
1184Const WHITE_BRUSH = 0
1185Const LTGRAY_BRUSH = 1
1186Const GRAY_BRUSH = 2
1187Const DKGRAY_BRUSH = 3
1188Const BLACK_BRUSH = 4
1189Const NULL_BRUSH = 5
1190Const HOLLOW_BRUSH = NULL_BRUSH
1191Const WHITE_PEN = 6
1192Const BLACK_PEN = 7
1193Const NULL_PEN = 8
1194Const OEM_FIXED_FONT = 10
1195Const ANSI_FIXED_FONT = 11
1196Const ANSI_VAR_FONT = 12
1197Const SYSTEM_FONT = 13
1198Const DEVICE_DEFAULT_FONT = 14
1199Const DEFAULT_PALETTE = 15
1200Const SYSTEM_FIXED_FONT = 16
1201'#if WINVER >= &h0400
1202Const DEFAULT_GUI_FONT = 17
1203'#endif
1204
1205Declare Function GetStockObject Lib "gdi32" (fnObject As Long) As HANDLE
1206
1207Declare Function GetStretchBltMode Lib "gdi32" (hdc As HDC) As Long
1208
1209Const TA_NOUPDATECP = 0
1210Const TA_UPDATECP = 1
1211Const TA_LEFT = 0
1212Const TA_RIGHT = 2
1213Const TA_CENTER = 6
1214Const TA_TOP = 0
1215Const TA_BOTTOM = 8
1216Const TA_BASELINE = 24
1217Const TA_RTLREADING = 256
1218Declare Function GetTextAlign Lib "gdi32" (hdc As HDC) As DWord
1219
1220Declare Function GetTextColor Lib "gdi32" (hdc As HDC) As DWord
1221Declare Function GetTextExtentPoint32A Lib "gdi32" (hdc As HDC, pString As PCSTR, cbString As Long, ByRef Size As SIZE) As Long
1222Declare Function GetTextExtentPoint32W Lib "gdi32" (hdc As HDC, pString As PCWSTR, cbString As Long, ByRef Size As SIZE) As Long
1223#ifdef UNICODE
1224Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32W" (hdc As HDC, pString As PCWSTR, cbString As Long, ByRef Size As SIZE) As Long
1225#else
1226Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (hdc As HDC, pString As PCSTR, cbString As Long, ByRef Size As SIZE) As Long
1227#endif
1228Declare Function GetTextFace Lib "gdi32" Alias _FuncName_GetTextFace (hdc As HDC, nCount As Long, lpFacename As LPTSTR)As Long
1229
1230Const TMPF_FIXED_PITCH = &H01
1231Const TMPF_VECTOR = &H02
1232Const TMPF_DEVICE = &H08
1233Const TMPF_TRUETYPE = &H04
1234Type TEXTMETRICW
1235 tmHeight As Long
1236 tmAscent As Long
1237 tmDescent As Long
1238 tmInternalLeading As Long
1239 tmExternalLeading As Long
1240 tmAveCharWidth As Long
1241 tmMaxCharWidth As Long
1242 tmWeight As Long
1243 tmOverhang As Long
1244 tmDigitizedAspectX As Long
1245 tmDigitizedAspectY As Long
1246 tmFirstChar As WCHAR
1247 tmLastChar As WCHAR
1248 tmDefaultChar As WCHAR
1249 tmBreakChar As WCHAR
1250 tmItalic As Byte
1251 tmUnderlined As Byte
1252 tmStruckOut As Byte
1253 tmPitchAndFamily As Byte
1254 tmCharSet As Byte
1255End Type
1256Type TEXTMETRICA
1257 tmHeight As Long
1258 tmAscent As Long
1259 tmDescent As Long
1260 tmInternalLeading As Long
1261 tmExternalLeading As Long
1262 tmAveCharWidth As Long
1263 tmMaxCharWidth As Long
1264 tmWeight As Long
1265 tmOverhang As Long
1266 tmDigitizedAspectX As Long
1267 tmDigitizedAspectY As Long
1268 tmFirstChar As SByte
1269 tmLastChar As SByte
1270 tmDefaultChar As SByte
1271 tmBreakChar As SByte
1272 tmItalic As Byte
1273 tmUnderlined As Byte
1274 tmStruckOut As Byte
1275 tmPitchAndFamily As Byte
1276 tmCharSet As Byte
1277End Type
1278#ifdef UNICODE
1279TypeDef TEXTMETRIC = TEXTMETRICW
1280#else
1281TypeDef TEXTMETRIC = TEXTMETRICA
1282#endif
1283Declare Function GetTextMetrics Lib "gdi32" Alias _FuncName_GetTextMetrics (hdc As HDC, ByRef tm As TEXTMETRIC) As Long
1284
1285Declare Function GetViewportExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
1286Declare Function GetViewportOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
1287Declare Function GetWindowExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
1288Declare Function GetWindowOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
1289Declare Function GetWinMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte, fnMapMode As Long, hdcRef As HDC) As DWord
1290Declare Function IntersectClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
1291Declare Function InvertRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1292Declare Function LineTo Lib "gdi32" (hdc As HDC, nXEnd As Long, nYEnd As Long) As Long
1293Declare Function LPtoDP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As Long
1294Declare Function MoveToEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1295Declare Function OffsetRgn Lib "gdi32" (hRgn As HRGN, nXOffset As Long, nYOffset As Long) As Long
1296Declare Function OffsetClipRgn Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long) As Long
1297Declare Function OffsetViewportOrgEx Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long, ByRef lpPoint As POINTAPI) As Long
1298Declare Function OffsetWindowOrgEx Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long, ByRef lpPoint As POINTAPI) As Long
1299Declare Function PaintRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1300Declare Function PatBlt Lib "gdi32" (hdc As HDC, nXLeft As Long, nYLeft As Long, nWidth As Long, nHeight As Long, dwRop As DWord) As Long
1301Declare Function PathToRegion Lib "gdi32" (hdc As HDC) As HRGN
1302Declare Function Pie Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nXRadial1 As Long, nYRadial1 As Long, nXRadial2 As Long, nYRadial2 As Long) As Long
1303Declare Function PlayEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, ByRef Rect As RECT) As Long
1304Declare Function PlayEnhMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef EnhMetaRecord As ENHMETARECORD, nHandles As DWord) As BOOL
1305Declare Function PlayMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE) As BOOL
1306Declare Function PlayMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef MetaRecord As METARECORD, nHandles As DWord) As BOOL
1307Declare Function PlgBlt Lib "gdi32" (hdcDest As HDC, ByRef lpPoint As POINTAPI, hdcSrc As HDC, nXSrc As Long, nYSrc As Long, nWidth As Long, nHeight As Long, hbmMask As HBITMAP, xMask As Long, yMask As Long) As Long
1308Declare Function PolyBezier Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
1309Declare Function PolyBezierTo Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
1310Declare Function Polygon Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, cPoints As Long) As Long
1311Declare Function Polyline Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
1312Declare Function PolylineTo Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
1313Declare Function PtInRegion Lib "gdi32" (hRgn As HRGN, x As Long, y As Long) As Long
1314Declare Function PtVisible Lib "gdi32" (hdc As HDC, x As Long, y As Long) As Long
1315Declare Function RealizePalette Lib "gdi32" (hdc As HDC) As Long
1316Declare Function Rectangle Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
1317Declare Function RectInRegion Lib "gdi32" (hRgn As HRGN, ByRef lpRect As RECT) As Long
1318Declare Function RectVisible Lib "gdi32" (hdc As HDC, ByRef lpRect As RECT) As Long
1319Declare Function ResetDC Lib "gdi32" Alias _FuncName_ResetDC (hdc As HDC, ByRef InitData As DEVMODE) As HDC
1320Declare Function RestoreDC Lib "gdi32" (hdc As HDC, nSavedDC As Long) As Long
1321Declare Function RoundRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nWidth As Long, nHeight As Long) As Long
1322Declare Function SaveDC Lib "gdi32" (hdc As HDC) As Long
1323Declare Function ScaleViewportExtEx Lib "gdi32" (hdc As HDC, Xnum As Long, Xdenom As Long, Ynum As Long, Ydenom As Long, ByRef lpSize As SIZE) As Long
1324Declare Function ScaleWindowExtEx Lib "gdi32" (hdc As HDC, Xnum As Long, Xdenom As Long, Ynum As Long, Ydenom As Long, ByRef lpSize As SIZE) As Long
1325Declare Function SelectClipPath Lib "gdi32" (hdc As HDC, iMode As Long) As Long
1326Declare Function SelectClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1327Declare Function SelectObject Lib "gdi32" (hdc As HDC, hObject As HANDLE) As HANDLE
1328Declare Function SelectPalette Lib "gdi32" (hdc As HDC, hpal As HPALETTE, bForceBackground As BOOL) As HPALETTE
1329Declare Function SetBkColor Lib "gdi32" (hdc As HDC, crColor As DWord) As DWord
1330
1331Const TRANSPARENT = 1
1332Const OPAQUE = 2
1333Declare Function SetBkMode Lib "gdi32" (hdc As HDC, iBkMode As Long) As Long
1334
1335Declare Function SetBrushOrgEx Lib "gdi32" (hdc As HDC, nXOrg As Long, nYOrg As Long, ByRef lppt As POINTAPI) As Long
1336Declare Function SetDIBits Lib "gdi32" (hdc As HDC, hbmp As HBITMAP, uStartScan As DWord, cScanLines As DWord, lpvBits As VoidPtr, ByRef lpbmi As BITMAPINFO, fuColorUse As DWord) As Long
1337Declare Function SetEnhMetaFileBits Lib "gdi32" (cbBuffer As DWord, pData As *Byte) As HENHMETAFILE
1338Declare Function SetMapMode Lib "gdi32" (hdc As HDC, fnMapMode As Long) As Long
1339Declare Function SetMetaFileBitsEx Lib "gdi32" (nSize As DWord, pData As *Byte) As HMETAFILE
1340Declare Function SetMiterLimit Lib "gdi32" (hdc As HDC, eNewLimit As Single, peOldLimit As SinglePtr) As Long
1341Declare Function SetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long, crColor As DWord) As DWord
1342Declare Function SetPolyFillMode Lib "gdi32" (hdc As HDC, iPolyFillMode As Long) As Long
1343Declare Function SetRectRgn Lib "gdi32" (hRgn As HRGN, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
1344Declare Function SetROP2 Lib "gdi32" (hdc As HDC, fnDrawMode As Long) As Long
1345
1346Const BLACKONWHITE = 1
1347Const WHITEONBLACK = 2
1348Const COLORONCOLOR = 3
1349Const HALFTONE = 4
1350Const STRETCH_ANDSCANS = BLACKONWHITE
1351Const STRETCH_ORSCANS = WHITEONBLACK
1352Const STRETCH_DELETESCANS = COLORONCOLOR
1353Const STRETCH_HALFTONE = HALFTONE
1354Declare Function SetStretchBltMode Lib "gdi32" (hdc As HDC, iStretchMode As Long) As Long
1355
1356Declare Function SetTextAlign Lib "gdi32" (hdc As HDC, fMode As DWord) As DWord
1357Declare Function SetTextColor Lib "gdi32" (hdc As HDC, crColor As DWord) As DWord
1358Declare Function SetViewportExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
1359Declare Function SetViewportOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1360Declare Function SetWindowExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
1361Declare Function SetWindowOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1362Declare Function SetWinMetaFileBits Lib "gdi32" (cbBuffer As DWord, pbBuffer As *Byte, hdcRef As HDC, ByRef mfp As METAFILEPICT) As HENHMETAFILE
1363Declare Function StartDoc Lib "gdi32" Alias _FuncName_StartDoc (hdc As HDC, ByRef di As DOCINFO) As Long
1364Declare Function StartPage Lib "gdi32" (hdc As HDC) As Long
1365Declare Function StretchBlt Lib "gdi32" (hdcDest As HDC, nXOriginDest As Long, nYOriginDest As Long, nWidthDest As Long, nHeightDest As Long, hdcSrc As HDC, nXOriginSrc As Long, nYOriginSrc As Long, nWidthSrc As Long, nHeightSrc As Long, dwRop As DWord) As Long
1366Declare Function StretchDIBits Lib "gdi32" (hdc As HDC, XDest As Long, YDest As Long, nDestWidth As Long, nDestHeight As Long, XSrc As Long, YSrc As Long, nSrcWidth As Long, nSrcHeight As Long, lpBits As VoidPtr, ByRef lpBitsInfo As BITMAPINFO, iUsage As Long, dwRop As DWord) As Long
1367Declare Function StrokeAndFillPath Lib "gdi32" (hdc As HDC) As Long
1368Declare Function StrokePath Lib "gdi32" (DC As DWord) As Long
1369Declare Function TextOutA Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCSTR, cbString As Long) As Long
1370Declare Function TextOutW Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCWSTR, cbString As Long) As Long
1371#ifdef UNICODE
1372Declare Function TextOut Lib "gdi32" Alias "TextOutW" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCWSTR, cbString As Long) As Long
1373#else
1374Declare Function TextOut Lib "gdi32" Alias "TextOutA" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCSTR, cbString As Long) As Long
1375#endif
1376Declare Function TransparentBlt Lib "msimg32" (hdcDest As HDC, nXDest As Long, nYDest As Long, nDestWidth As Long, nDestHeight As Long, hdcSrc As HDC, XSrc As Long, YSrc As Long, nSrcWidth As Long, nSrcHeight As Long, dwRop As DWord) As Long
1377
1378/* Pixel Format */
1379Type PIXELFORMATDESCRIPTOR
1380 nSize As Word
1381 nVersion As Word
1382 dwFlags As DWord
1383 iPixelType As Byte
1384 cColorBits As Byte
1385 cRedBits As Byte
1386 cRedShift As Byte
1387 cGreenBits As Byte
1388 cGreenShift As Byte
1389 cBlueBits As Byte
1390 cBlueShift As Byte
1391 cAlphaBits As Byte
1392 cAlphaShift As Byte
1393 cAccumBits As Byte
1394 cAccumRedBits As Byte
1395 cAccumGreenBits As Byte
1396 cAccumBlueBits As Byte
1397 cAccumAlphaBits As Byte
1398 cDepthBits As Byte
1399 cStencilBits As Byte
1400 cAuxBuffers As Byte
1401 iLayerType As Byte
1402 bReserved As Byte
1403 dwLayerMask As DWord
1404 dwVisibleMask As DWord
1405 dwDamageMask As DWord
1406End Type
1407TypeDef PPIXELFORMATDESCRIPTOR = *PIXELFORMATDESCRIPTOR
1408TypeDef LPPIXELFORMATDESCRIPTOR = *PIXELFORMATDESCRIPTOR
1409
1410Const PFD_TYPE_RGBA = 0
1411Const PFD_TYPE_COLORINDEX = 1
1412
1413Const PFD_MAIN_PLANE = 0
1414Const PFD_OVERLAY_PLANE = 1
1415Const PFD_UNDERLAY_PLANE = (-1)
1416
1417Const PFD_DOUBLEBUFFER = &H00000001
1418Const PFD_STEREO = &H00000002
1419Const PFD_DRAW_TO_WINDOW = &H00000004
1420Const PFD_DRAW_TO_BITMAP = &H00000008
1421Const PFD_SUPPORT_GDI = &H00000010
1422Const PFD_SUPPORT_OPENGL = &H00000020
1423Const PFD_GENERIC_FORMAT = &H00000040
1424Const PFD_NEED_PALETTE = &H00000080
1425Const PFD_NEED_SYSTEM_PALETTE = &H00000100
1426Const PFD_SWAP_EXCHANGE = &H00000200
1427Const PFD_SWAP_COPY = &H00000400
1428Const PFD_SWAP_LAYER_BUFFERS = &H00000800
1429Const PFD_GENERIC_ACCELERATED = &H00001000
1430Const PFD_SUPPORT_DIRECTDRAW = &H00002000
1431
1432Const PFD_DEPTH_DONTCARE = &H20000000
1433Const PFD_DOUBLEBUFFER_DONTCARE = &H40000000
1434Const PFD_STEREO_DONTCARE = &H80000000
1435
1436Declare Function ChoosePixelFormat Lib "gdi32" (hdc As HDC, ByRef lppfd As PIXELFORMATDESCRIPTOR) As Long
1437Declare Function DescribePixelFormat Lib "gdi32" (hdc As HDC, n As Long, u As DWord, ByRef lppfd As PIXELFORMATDESCRIPTOR) As Long
1438Declare Function GetPixelFormat Lib "gdi32" (hdc As HDC) As Long
1439Declare Function SetPixelFormat Lib "gdi32" (hdc As HDC, i As Long, ByRef lppfd As PIXELFORMATDESCRIPTOR) As BOOL
1440
1441
1442/* OpenGL Support */
1443
1444Declare Function wglCopyContext Lib "opengl32" (hglrcSource As HGLRC, hglrcDest As HGLRC, mask As DWord) As BOOL
1445Declare Function wglCreateContext Lib "opengl32" (hdc As HDC) As HGLRC
1446Declare Function wglCreateLayerContext Lib "opengl32" (hdc As HDC, iLayerPlane As Long) As HGLRC
1447Declare Function wglDeleteContext Lib "opengl32" (hglrc As HGLRC) As BOOL
1448Declare Function wglGetCurrentContext Lib "opengl32" () As HGLRC
1449Declare Function wglGetCurrentDC Lib "opengl32" () As HDC
1450Declare Function wglGetProcAddress Lib "opengl32" (lpstr As LPSTR) As PROC
1451Declare Function wglMakeCurrent Lib "opengl32" (hdc As HDC, hglrc As HGLRC) As BOOL
1452Declare Function wglShareLists Lib "opengl32" (hglrc1 As HGLRC, hglrc2 As HGLRC) As BOOL
1453Declare Function wglUseFontBitmaps Lib "opengl32" Alias _FuncName_wglUseFontBitmaps (hdc As HDC, first As DWord, count As DWord, listbase As DWord) As BOOL
1454Declare Function SwapBuffers Lib "gdi32" (hdc As HDC) As BOOL
1455
1456Type POINTFLOAT
1457 x As Single
1458 y As Single
1459End Type
1460TypeDef PPOINTFLOAT = *POINTFLOAT
1461
1462Type GLYPHMETRICSFLOAT
1463 gmfBlackBoxX As Single
1464 gmfBlackBoxY As Single
1465 gmfptGlyphOrigin As POINTFLOAT
1466 gmfCellIncX As Single
1467 gmfCellIncY As Single
1468End Type
1469TypeDef PGLYPHMETRICSFLOAT = *GLYPHMETRICSFLOAT
1470TypeDef LPGLYPHMETRICSFLOAT = *GLYPHMETRICSFLOAT
1471
1472Const WGL_FONT_LINES = 0
1473Const WGL_FONT_POLYGONS = 1
1474
1475Declare Function wglUseFontOutlines Lib "opengl32" Alias _FuncName_wglUseFontOutlines (hdc As HDC, first As DWord, count As DWord, listbase As DWord, deviation As Single, extrusion As Single, format As Long, ByRef lpgmf As GLYPHMETRICSFLOAT) As BOOL
1476
1477Type LAYERPLANEDESCRIPTOR
1478 nSize As Word
1479 nVersion As Word
1480 dwFlags As DWord
1481 iPixelType As Byte
1482 cColorBits As Byte
1483 cRedBits As Byte
1484 cRedShift As Byte
1485 cGreenBits As Byte
1486 cGreenShift As Byte
1487 cBlueBits As Byte
1488 cBlueShift As Byte
1489 cAlphaBits As Byte
1490 cAlphaShift As Byte
1491 cAccumBits As Byte
1492 cAccumRedBits As Byte
1493 cAccumGreenBits As Byte
1494 cAccumBlueBits As Byte
1495 cAccumAlphaBits As Byte
1496 cDepthBits As Byte
1497 cStencilBits As Byte
1498 cAuxBuffers As Byte
1499 iLayerPlane As Byte
1500 bReserved As Byte
1501 crTransparent As COLORREF
1502End Type
1503TypeDef PLAYERPLANEDESCRIPTOR = *LAYERPLANEDESCRIPTOR
1504TypeDef LPLAYERPLANEDESCRIPTOR = *LAYERPLANEDESCRIPTOR
1505
1506Const LPD_DOUBLEBUFFER = &H00000001
1507Const LPD_STEREO = &H00000002
1508Const LPD_SUPPORT_GDI = &H00000010
1509Const LPD_SUPPORT_OPENGL = &H00000020
1510Const LPD_SHARE_DEPTH = &H00000040
1511Const LPD_SHARE_STENCIL = &H00000080
1512Const LPD_SHARE_ACCUM = &H00000100
1513Const LPD_SWAP_EXCHANGE = &H00000200
1514Const LPD_SWAP_COPY = &H00000400
1515Const LPD_TRANSPARENT = &H00001000
1516Const LPD_TYPE_RGBA = 0
1517Const LPD_TYPE_COLORINDEX = 1
1518
1519Const WGL_SWAP_MAIN_PLANE = &H00000001
1520Const WGL_SWAP_OVERLAY1 = &H00000002
1521Const WGL_SWAP_OVERLAY2 = &H00000004
1522Const WGL_SWAP_OVERLAY3 = &H00000008
1523Const WGL_SWAP_OVERLAY4 = &H00000010
1524Const WGL_SWAP_OVERLAY5 = &H00000020
1525Const WGL_SWAP_OVERLAY6 = &H00000040
1526Const WGL_SWAP_OVERLAY7 = &H00000080
1527Const WGL_SWAP_OVERLAY8 = &H00000100
1528Const WGL_SWAP_OVERLAY9 = &H00000200
1529Const WGL_SWAP_OVERLAY10 = &H00000400
1530Const WGL_SWAP_OVERLAY11 = &H00000800
1531Const WGL_SWAP_OVERLAY12 = &H00001000
1532Const WGL_SWAP_OVERLAY13 = &H00002000
1533Const WGL_SWAP_OVERLAY14 = &H00004000
1534Const WGL_SWAP_OVERLAY15 = &H00008000
1535Const WGL_SWAP_UNDERLAY1 = &H00010000
1536Const WGL_SWAP_UNDERLAY2 = &H00020000
1537Const WGL_SWAP_UNDERLAY3 = &H00040000
1538Const WGL_SWAP_UNDERLAY4 = &H00080000
1539Const WGL_SWAP_UNDERLAY5 = &H00100000
1540Const WGL_SWAP_UNDERLAY6 = &H00200000
1541Const WGL_SWAP_UNDERLAY7 = &H00400000
1542Const WGL_SWAP_UNDERLAY8 = &H00800000
1543Const WGL_SWAP_UNDERLAY9 = &H01000000
1544Const WGL_SWAP_UNDERLAY10 = &H02000000
1545Const WGL_SWAP_UNDERLAY11 = &H04000000
1546Const WGL_SWAP_UNDERLAY12 = &H08000000
1547Const WGL_SWAP_UNDERLAY13 = &H10000000
1548Const WGL_SWAP_UNDERLAY14 = &H20000000
1549Const WGL_SWAP_UNDERLAY15 = &H40000000
1550
1551Declare Function wglDescribeLayerPlane Lib "opengl32" (hdc As HDC, iPixelFormat As Long, iLayerPlane As Long, nByte As DWord, ByRef lplpd As LAYERPLANEDESCRIPTOR) As BOOL
1552Declare Function wglSetLayerPaletteEntries Lib "opengl32" (hdc As HDC, iLayerPlane As Long, iStart As Long, cEntries As Long, lpcr As *COLORREF) As Long
1553Declare Function wglGetLayerPaletteEntries Lib "opengl32" (hdc As HDC, iLayerPlane As Long, iStart As Long, cEntries As Long, lpcr As *COLORREF) As Long
1554Declare Function wglRealizeLayerPalette Lib "opengl32" (hdc As HDC, iLayerPlane As Long, bRealize As BOOL) As BOOL
1555Declare Function wglSwapLayerBuffers Lib "opengl32" (hdc As HDC, fuPlanes As DWord) As BOOL
1556
1557Type WGLSWAP
1558 hdc As HDC
1559 uiFlags As DWord
1560End Type
1561TypeDef PWGLSWAP = *WGLSWAP
1562TypeDef LPWGLSWAP = *WGLSWAP
1563
1564Const WGL_SWAPMULTIPLE_MAX = 16
1565
1566'Declare Function wglSwapMultipleBuffers Lib "opengl32" (u As DWord, lpwglswap As *WGLSWAP) As DWord
Note: See TracBrowser for help on using the repository browser.