source: Include/api_gdi.sbp@ 137

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

#55#73#75とりあえず完了

File size: 47.5 KB
Line 
1' api_gdi.sbp - Graphics Device Integerface API
2
3
4#ifndef _INC_GDI
5#define _INC_GDI
6
7#ifdef UNICODE
8Const _FuncName_CreateFontIndirect = "CreateFontIndirectW"
9#else
10Const _FuncName_CreateFontIndirect = "CreateFontIndirectA"
11#endif
12
13Const CLR_INVALID = &HFFFFFFFF
14Const GDI_ERROR = &HFFFFFFFF
15
16TypeDef BCHAR = TBYTE
17
18Type _System_DeclareHandle_HPALETTE:unused As DWord:End Type
19TypeDef HPALETTE = *_System_DeclareHandle_HPALETTE
20
21' Point/Rectangle/Size struct
22Type POINTAPI
23 x As Long
24 y As Long
25End Type
26
27Type RECT
28 left As Long
29 top As Long
30 right As Long
31 bottom As Long
32End Type
33
34Type SIZE
35 cx As Long
36 cy As Long
37End Type
38
39' Metafile and EnhancedMetafile
40Type EMR
41 iType As DWord
42 nSize As DWord
43End Type
44
45Type Align(2) METAHEADER
46 mtType As Word
47 mtHeaderSize As Word
48 mtVersion As Word
49 mtSize As DWord
50 mtNoObjects As Word
51 mtMaxRecord As DWord
52 mtNoParameters As Word
53End Type
54TypeDef PMETAHEADER = *METAHEADER
55
56Type ENHMETAHEADER
57 iType As DWord
58 nSize As DWord
59 rclBounds As RECT
60 rclFrame As RECT
61 dSignature As DWord
62 nVersion As DWord
63 nBytes As DWord
64 nRecords As DWord
65 nHandles As Word
66 sReserved As Word
67 nDescription As DWord
68 offDescription As DWord
69 nPalEntries As DWord
70 szlDevice As SIZE
71 szlMillimeters As SIZE
72 cbPixelFormat As DWord
73 offPixelFormat As DWord
74 bOpenGL As DWord
75'#if WINVER >= 0x0500
76 'szlMicrometers As SIZE
77'#endif
78End Type
79TypeDef PENHMETAHEADER = *ENHMETAHEADER
80
81Type HANDLETABLE
82 objectHandle[ELM(1)] As HGDIOBJ
83End Type
84
85Type METARECORD
86 rdSize As DWord
87 rdFunction As Word
88 rdParm[ELM(1)] As Word
89End Type
90
91Type ENHMETARECORD
92 iType As DWord
93 nSize As DWord
94 dParm[ELM(1)] As DWord
95End Type
96
97Type METAFILEPICT
98 mm As Long
99 xExt As Long
100 yExt As Long
101 hMF As HMETAFILE
102End Type
103
104TypeDef ENHMFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef EMFR As ENHMETARECORD, nObj As Long, lpData As LPARAM) As Long
105TypeDef MFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef MFR As METARECORD, nObj As Long, lpClientData As LPARAM)
106
107
108' RGB Color
109Const RGB(r, g, b) = ((r) As Long) Or (((g) As Long) <<8) Or (((b) As Long) <<16)
110Const PALETTERGB(r, g, b) = (&h02000000 Or RGB(r,g,b))
111Const PALETTEINDEX(i) = ((&h01000000 Or (i) As Word As DWord) As COLORREF)
112
113Const GetRValue(rgb) = (rgb And &hff)
114Const GetGValue(rgb) = ((rgb >> 8) And &hff)
115Const GetBValue(rgb) = ((rgb >> 16) And &hff)
116
117Type RGBQUAD
118 rgbBlue As Byte
119 rgbGreen As Byte
120 rgbRed As Byte
121 rgbReserved As Byte
122End Type
123
124Type Align(1) RGBTRIPLE
125 rgbtBlue As Byte
126 rgbtGreen As Byte
127 rgbtRed As Byte
128End Type
129
130' CMYK Color
131Const GetKValue(cmyk) = ((cmyk) As Byte)
132Const GetYValue(cmyk) = (((cmyk) >> 8) As Byte)
133Const GetMValue(cmyk) = (((cmyk) >> 16) As Byte)
134Const GetCValue(cmyk) = (((cmyk) >> 24) As Byte)
135
136Const CMYK(c, m, y, k) = (( _
137 ((k) As Byte) Or _
138 ((y) As Byte As Word << 8) Or _
139 ((m) As Byte As DWord << 16) Or _
140 ((c) As Byte As DWord << 24)) As COLORREF)
141
142' ICM Color
143TypeDef FXPT16DOT16 = Long
144TypeDef FXPT2DOT30 = Long
145
146TypeDef LCSCSTYPE = Long
147TypeDef LCSGAMUTMATCH = Long
148
149Type LOGCOLORSPACEA
150 lcsSignature As DWord
151 lcsVersion As DWord
152 lcsSize As DWord
153 lcsCSType As LCSCSTYPE
154 lcsIntent As LCSGAMUTMATCH
155 lcsEndpoints As CIEXYZTRIPLE
156 lcsGammaRed As DWord
157 lcsGammaGreen As DWord
158 lcsGammaBlue As DWord
159 lcsFilename[MAX_PATH] As SByte
160End Type
161Type LOGCOLORSPACEW
162 lcsSignature As DWord
163 lcsVersion As DWord
164 lcsSize As DWord
165 lcsCSType As LCSCSTYPE
166 lcsIntent As LCSGAMUTMATCH
167 lcsEndpoints As CIEXYZTRIPLE
168 lcsGammaRed As DWord
169 lcsGammaGreen As DWord
170 lcsGammaBlue As DWord
171 lcsFilename[ELM(MAX_PATH)] As WCHAR
172End Type
173#ifdef UNICODE
174TypeDef LOGCOLORSPACE = LOGCOLORSPACEW
175#else
176TypeDef LOGCOLORSPACE = LOGCOLORSPACEA
177#endif
178
179Type CIEXYZ
180 ciexyzX As FXPT2DOT30
181 ciexyzY As FXPT2DOT30
182 ciexyzZ As FXPT2DOT30
183End Type
184
185Type CIEXYZTRIPLE
186 ciexyzRed As CIEXYZ
187 ciexyzGreen As CIEXYZ
188 ciexyzBlue As CIEXYZ
189End Type
190
191
192
193' raster operations
194Const SRCCOPY = &H00CC0020
195Const SRCPAINT = &H00EE0086
196Const SRCAND = &H008800C6
197Const SRCINVERT = &H00660046
198Const SRCERASE = &H00440328
199Const NOTSRCCOPY = &H00330008
200Const NOTSRCERASE = &H001100A6
201Const MERGECOPY = &H00C000CA
202Const MERGEPAINT = &H00BB0226
203Const PATCOPY = &H00F00021
204Const PATPAINT = &H00FB0A09
205Const PATINVERT = &H005A0049
206Const DSTINVERT = &H00550009
207Const BLACKNESS = &H00000042
208Const WHITENESS = &H00FF0062
209
210
211' Object types
212Const OBJ_PEN = 1
213Const OBJ_BRUSH = 2
214Const OBJ_DC = 3
215Const OBJ_METADC = 4
216Const OBJ_PAL = 5
217Const OBJ_FONT = 6
218Const OBJ_BITMAP = 7
219Const OBJ_REGION = 8
220Const OBJ_METAFILE = 9
221Const OBJ_MEMDC = 10
222Const OBJ_EXTPEN = 11
223Const OBJ_ENHMETADC = 12
224Const OBJ_ENHMETAFILE = 13
225
226
227' Bitmap Header Definition
228Type BITMAP
229 bmType As Long
230 bmWidth As Long
231 bmHeight As Long
232 bmWidthBytes As Long
233 bmPlanes As Word
234 bmBitsPixel As Word
235 bmBits As VoidPtr
236End Type
237
238Type BITMAPCOREHEADER
239 bcSize As DWord
240 bcWidth As Word
241 bcHeight As Word
242 bcPlanes As Word
243 bcBitCount As Word
244End Type
245
246Type BITMAPCOREINFO
247 bmciHeader As BITMAPCOREHEADER
248 bmciColors[ELM(1)] As RGBTRIPLE
249End Type
250
251' structures for defining DIBs
252Const BI_RGB = 0
253Const BI_RLE8 = 1
254Const BI_RLE4 = 2
255Const BI_BITFIELDS = 3
256Const BI_JPEG = 4
257Const BI_PNG = 5
258
259Type BITMAPINFOHEADER
260 biSize As DWord
261 biWidth As Long
262 biHeight As Long
263 biPlanes As Word
264 biBitCount As Word
265 biCompression As DWord
266 biSizeImage As DWord
267 biXPelsPerMeter As Long
268 biYPelsPerMeter As Long
269 biClrUsed As DWord
270 biClrImportant As DWord
271End Type
272
273Type BITMAPINFO
274 bmiHeader As BITMAPINFOHEADER
275 bmiColors[ELM(1)] As RGBQUAD '以前はbmpColors[255] As RGBQUADだったことに注意
276End Type
277
278
279' Bitmap file header struct
280Type Align(2) BITMAPFILEHEADER
281 bfType As Word
282 bfSize As DWord
283 bfReserved1 As Word
284 bfReserved2 As Word
285 bfOffBits As DWord
286End Type
287
288Type BITMAPV4HEADER
289 bV4Size As DWord
290 bV4Width As Long
291 bV4Height As Long
292 bV4Planes As Word
293 bV4BitCount As Word
294 bV4V4Compression As DWord
295 bV4SizeImage As DWord
296 bV4XPelsPerMeter As Long
297 bV4YPelsPerMeter As Long
298 bV4ClrUsed As DWord
299 bV4ClrImportant As DWord
300 bV4RedMask As DWord
301 bV4GreenMask As DWord
302 bV4BlueMask As DWord
303 bV4AlphaMask As DWord
304 bV4CSType As DWord
305 bV4Endpoints As CIEXYZTRIPLE
306 bV4GammaRed As DWord
307 bV4GammaGreen As DWord
308 bV4GammaBlue As DWord
309End Type
310
311' Region flags
312Const NULLREGION = 1
313Const SIMPLEREGION = 2
314Const COMPLEXREGION = 3
315
316
317' Poly fill mode
318Const ALTERNATE = 1
319Const WINDING = 2
320
321
322' Device mode
323Const DM_ORIENTATION = &H00000001
324Const DM_PAPERSIZE = &H00000002
325Const DM_PAPERLENGTH = &H00000004
326Const DM_PAPERWIDTH = &H00000008
327Const DM_SCALE = &H00000010
328Const DM_POSITION = &H00000020
329Const DM_COPIES = &H00000100
330Const DM_DEFAULTSOURCE = &H00000200
331Const DM_PRINTQUALITY = &H00000400
332Const DM_COLOR = &H00000800
333Const DM_DUPLEX = &H00001000
334Const DM_YRESOLUTION = &H00002000
335Const DM_TTOPTION = &H00004000
336Const DM_COLLATE = &H00008000
337Const DM_FORMNAME = &H00010000
338Const DM_LOGPIXELS = &H00020000
339Const DM_BITSPERPEL = &H00040000
340Const DM_PELSWIDTH = &H00080000
341Const DM_PELSHEIGHT = &H00100000
342Const DM_DISPLAYFLAGS = &H00200000
343Const DM_DISPLAYFREQUENCY = &H00400000
344Const DMORIENT_PORTRAIT = 1
345Const DMORIENT_LANDSCAPE = 2
346Const DMPAPER_LETTER = 1
347Const DMPAPER_LETTERSMALL = 2
348Const DMPAPER_TABLOID = 3
349Const DMPAPER_LEDGER = 4
350Const DMPAPER_LEGAL = 5
351Const DMPAPER_STATEMENT = 6
352Const DMPAPER_EXECUTIVE = 7
353Const DMPAPER_A3 = 8
354Const DMPAPER_A4 = 9
355Const DMPAPER_A4SMALL = 10
356Const DMPAPER_A5 = 11
357Const DMPAPER_B4 = 12
358Const DMPAPER_B5 = 13
359Const DMPAPER_FOLIO = 14
360Const DMPAPER_QUARTO = 15
361Const DMPAPER_10X14 = 16
362Const DMPAPER_11X17 = 17
363Const DMPAPER_NOTE = 18
364Const DMPAPER_ENV_9 = 19
365Const DMPAPER_ENV_10 = 20
366Const DMPAPER_ENV_11 = 21
367Const DMPAPER_ENV_12 = 22
368Const DMPAPER_ENV_14 = 23
369Const DMPAPER_CSHEET = 24
370Const DMPAPER_DSHEET = 25
371Const DMPAPER_ESHEET = 26
372Const DMPAPER_ENV_DL = 27
373Const DMPAPER_ENV_C5 = 28
374Const DMPAPER_ENV_C3 = 29
375Const DMPAPER_ENV_C4 = 30
376Const DMPAPER_ENV_C6 = 31
377Const DMPAPER_ENV_C65 = 32
378Const DMPAPER_ENV_B4 = 33
379Const DMPAPER_ENV_B5 = 34
380Const DMPAPER_ENV_B6 = 35
381Const DMPAPER_ENV_ITALY = 36
382Const DMPAPER_ENV_MONARCH = 37
383Const DMPAPER_ENV_PERSONAL = 38
384Const DMPAPER_FANFOLD_US = 39
385Const DMPAPER_FANFOLD_STD_GERMAN = 40
386Const DMPAPER_FANFOLD_LGL_GERMAN = 41
387Const DMRES_DRAFT = -1
388Const DMRES_LOW = -2
389Const DMRES_MEDIUM = -3
390Const DMRES_HIGH = -4
391Const DMCOLOR_MONOCHROME = 1
392Const DMCOLOR_COLOR = 2
393Const DMDUP_SIMPLEX = 1
394Const DMDUP_VERTICAL = 2
395Const DMDUP_HORIZONTAL = 3
396Const DMTT_BITMAP = 1
397Const DMTT_DOWNLOAD = 2
398Const DMTT_SUBDEV = 3
399Const DMCOLLATE_FALSE = 0
400Const DMCOLLATE_TRUE = 1
401
402Const CCHDEVICENAME = 32
403Const CCHFORMNAME = 32
404Type _devicemodeA
405 dmDeviceName[ELM(CCHDEVICENAME)] As Byte
406 dmSpecVersion As Word
407 dmDriverVersion As Word
408 dmSize As Word
409 dmDriverExtra As Word
410 dmFields As DWord
411 dmOrientation As Integer
412 dmPaperSize As Integer
413 dmPaperLength As Integer
414 dmPaperWidth As Integer
415 dmScale As Integer
416 dmCopies As Integer
417 dmDefaultSource As Integer
418 dmPrintQuality As Integer
419 dmColor As Integer
420 dmDuplex As Integer
421 dmYResolution As Integer
422 dmTTOption As Integer
423 dmCollate As Integer
424 dmFormName[ELM(CCHFORMNAME)] As Byte
425 dmLogPixels As Word
426 dmBitsPerPel As DWord
427 dmPelsWidth As DWord
428 dmPelsHeight As DWord
429 dmDisplayFlags As DWord
430 dmDisplayFrequency As DWord
431 dmICMMethod As DWord
432 dmICMIntent As DWord
433 dmMediaType As DWord
434 dmDitherType As DWord
435 dmReserved1 As DWord
436 dmReserved2 As DWord
437 dmPanningWidth As DWord
438 dmPanningHeight As DWord
439End Type
440TypeDef DEVMODEA = _devicemodeA
441TypeDef DEVMODE = DEVMODEA
442
443
444' Binary raster ops
445Const R2_BLACK = 1
446Const R2_NOTMERGEPEN = 2
447Const R2_MASKNOTPEN = 3
448Const R2_NOTCOPYPEN = 4
449Const R2_MASKPENNOT = 5
450Const R2_NOT = 6
451Const R2_XORPEN = 7
452Const R2_NOTMASKPEN = 8
453Const R2_MASKPEN = 9
454Const R2_NOTXORPEN = 10
455Const R2_NOP = 11
456Const R2_MERGENOTPEN = 12
457Const R2_COPYPEN = 13
458Const R2_MERGEPENNOT = 14
459Const R2_MERGEPEN = 15
460Const R2_WHITE = 16
461
462
463Type RGNDATAHEADER
464 dwSize As DWord
465 iType As DWord
466 nCount As DWord
467 nRgnSize As DWord
468 rcBound As RECT
469End Type
470Type RGNDATA
471 rdh As RGNDATAHEADER
472 Buffer As Byte
473End Type
474
475Type PALETTEENTRY
476 peRed As Byte
477 peGreen As Byte
478 peBlue As Byte
479 peFlags As Byte
480End Type
481
482Type DOCINFO
483 cbSize As Long
484 lpszDocName As LPCSTR
485 lpszOutput As LPCSTR
486 lpszDatatype As LPCSTR
487 fwType As DWord
488End Type
489
490'-------------------
491' GDI API Functions
492'-------------------
493
494Declare Function AbortPath Lib "gdi32" (hdc As HDC) As BOOL
495Declare 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
496Declare Function BeginPath Lib "gdi32" (hdc As HDC) As BOOL
497Declare 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
498Declare Function CancelDC Lib "gdi32" (hdc As HDC) As BOOL
499Declare 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
500Declare Function CloseEnhMetaFile Lib "gdi32" (hdc As HDC) As HENHMETAFILE
501Declare Function CloseFigure Lib "gdi32" (hdc As HDC) As BOOL
502Declare Function CloseMetaFile Lib "gdi32" (hdc As HDC) As HMETAFILE
503
504Const RGN_AND = 1
505Const RGN_OR = 2
506Const RGN_XOR = 3
507Const RGN_DIFF = 4
508Const RGN_COPY = 5
509Declare Function CombineRgn Lib "gdi32" (hrgnDest As HRGN, hrgnSrc1 As HRGN, hrgnSrc2 As HRGN, fnCombineMode As Long) As Long
510Declare Function CopyEnhMetaFile Lib "gdi32" Alias "CopyEnhMetaFileA" (hemfSrc As HENHMETAFILE, pszFile As PCSTR) As HENHMETAFILE
511Declare Function CopyMetaFile Lib "gdi32" Alias "CopyMetaFileA" (hmfSrc As HMETAFILE, pszFile As PCSTR) As HMETAFILE
512Declare Function CreateBitmap Lib "gdi32" (nWidth As Long, nHeight As Long, cPlanes As Long, cBitsPerPel As Long, lpvBits As VoidPtr) As HBITMAP
513Declare Function CreateBitmapIndirect Lib "gdi32" (ByRef lpbm As BITMAP) As HBITMAP
514
515Const BS_SOLID = 0
516Const BS_NULL = 1
517Const BS_HOLLOW = BS_NULL
518Const BS_HATCHED = 2
519Const BS_PATTERN = 3
520Const BS_INDEXED = 4
521Const BS_DIBPATTERN = 5
522Const BS_DIBPATTERNPT = 6
523Const BS_PATTERN8X8 = 7
524Const BS_DIBPATTERN8X8 = 8
525Const BS_MONOPATTERN = 9
526Const DIB_RGB_COLORS = 0
527Const DIB_PAL_COLORS = 1
528Const HS_HORIZONTAL = 0
529Const HS_VERTICAL = 1
530Const HS_FDIAGONAL = 2
531Const HS_BDIAGONAL = 3
532Const HS_CROSS = 4
533Const HS_DIAGCROSS = 5
534Type LOGBRUSH
535 lbStyle As Long
536 lbColor As Long
537 lbHatch As Long
538End Type
539Declare Function CreateBrushIndirect Lib "gdi32" (ByRef lplb As LOGBRUSH) As HBRUSH
540
541Declare Function CreateCompatibleBitmap Lib "gdi32" (hdc As HDC, nWidth As Long, nHeight As Long) As HBITMAP
542Declare Function CreateCompatibleDC Lib "gdi32" (hdc As HDC) As HDC
543Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (lpszDriver As PCSTR, lpszDevice As PCSTR, lpszOutput As PCSTR, ByRef lpInitData As DEVMODE) As HDC
544
545Const CBM_INIT = &H04
546Declare Function CreateDIBitmap Lib "gdi32" (hdc As HDC, ByRef lpbmih As BITMAPINFOHEADER, fdwInit As Long, lpbInit As VoidPtr, ByRef lpbmi As BITMAPINFO, fuUsage As Long) As HBITMAP
547
548Declare Function CreateDIBPatternBrushPt Lib "gdi32" (lpPackedDIB As VoidPtr, iUsage As Long) As HBRUSH
549Declare 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
550Declare Function CreateEllipticRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN
551Declare Function CreateEllipticRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN
552Declare Function CreateEnhMetaFile Lib "gdi32" Alias "CreateEnhMetaFileA" (hdcRef As HDC, pFileName As PCTSTR, ByRef Rect As RECT, pDescription As PCTSTR) As HDC
553Declare Function CreateMetaFile Lib "gdi32" Alias "CreateMetaFileA" (pFileName As PCTSTR) As HDC
554
555Const FW_DONTCARE = 0
556Const FW_THIN = 100
557Const FW_EXTRALIGHT = 200
558Const FW_LIGHT = 300
559Const FW_NORMAL = 400
560Const FW_MEDIUM = 500
561Const FW_SEMIBOLD = 600
562Const FW_BOLD = 700
563Const FW_EXTRABOLD = 800
564Const FW_HEAVY = 900
565Const FW_ULTRALIGHT = FW_EXTRALIGHT
566Const FW_REGULAR = FW_NORMAL
567Const FW_DEMIBOLD = FW_SEMIBOLD
568Const FW_ULTRABOLD = FW_EXTRABOLD
569Const FW_BLACK = FW_HEAVY
570
571Const ANSI_CHARSET = 0
572Const DEFAULT_CHARSET = 1
573Const SYMBOL_CHARSET = 2
574Const SHIFTJIS_CHARSET = 128
575Const HANGEUL_CHARSET = 129
576Const HANGUL_CHARSET = 129
577Const GB2312_CHARSET = 134
578Const CHINESEBIG5_CHARSET = 136
579Const OEM_CHARSET = 255
580Const JOHAB_CHARSET = 130
581Const HEBREW_CHARSET = 177
582Const ARABIC_CHARSET = 178
583Const GREEK_CHARSET = 161
584Const TURKISH_CHARSET = 162
585Const VIETNAMESE_CHARSET = 163
586Const THAI_CHARSET = 222
587Const EASTEUROPE_CHARSET = 238
588Const RUSSIAN_CHARSET = 204
589Const MAC_CHARSET = 77
590Const BALTIC_CHARSET = 186
591
592Const OUT_DEFAULT_PRECIS = 0
593Const OUT_STRING_PRECIS = 1
594Const OUT_CHARACTER_PRECIS = 2
595Const OUT_STROKE_PRECIS = 3
596Const OUT_TT_PRECIS = 4
597Const OUT_DEVICE_PRECIS = 5
598Const OUT_RASTER_PRECIS = 6
599Const OUT_TT_ONLY_PRECIS = 7
600Const OUT_OUTLINE_PRECIS = 8
601Const OUT_SCREEN_OUTLINE_PRECIS = 9
602
603Const CLIP_DEFAULT_PRECIS = 0
604Const CLIP_CHARACTER_PRECIS = 1
605Const CLIP_STROKE_PRECIS = 2
606Const CLIP_MASK = &Hf
607Const CLIP_LH_ANGLES = &H00010000
608Const CLIP_TT_ALWAYS = &H00020000
609Const CLIP_EMBEDDED = &H00080000
610
611Const DEFAULT_QUALITY = 0
612Const DRAFT_QUALITY = 1
613Const PROOF_QUALITY = 2
614Const NONANTIALIASED_QUALITY =3
615Const ANTIALIASED_QUALITY = 4
616
617Const DEFAULT_PITCH = 0
618Const FIXED_PITCH = 1
619Const VARIABLE_PITCH = 2
620
621Const FF_DONTCARE = 0
622Const FF_ROMAN = &H00010000
623Const FF_SWISS = &H00020000
624Const FF_MODERN = &H00030000
625Const FF_SCRIPT = &H00040000
626Const FF_DECORATIVE = &H00050000
627Declare Function CreateFont Lib "gdi32" Alias "CreateFontA" (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 PCSTR) As HFONT
628
629Const LF_FACESIZE = 32
630Type LOGFONTA
631 lfHeight As Long
632 lfWidth As Long
633 lfEscapement As Long
634 lfOrientation As Long
635 lfWeight As Long
636 lfItalic As Byte
637 lfUnderline As Byte
638 lfStrikeOut As Byte
639 lfCharSet As Byte
640 lfOutPrecision As Byte
641 lfClipPrecision As Byte
642 lfQuality As Byte
643 lfPitchAndFamily As Byte
644 lfFaceName[ELM(LF_FACESIZE)] As Byte
645End Type
646Type LOGFONTW
647 lfHeight As Long
648 lfWidth As Long
649 lfEscapement As Long
650 lfOrientation As Long
651 lfWeight As Long
652 lfItalic As Byte
653 lfUnderline As Byte
654 lfStrikeOut As Byte
655 lfCharSet As Byte
656 lfOutPrecision As Byte
657 lfClipPrecision As Byte
658 lfQuality As Byte
659 lfPitchAndFamily As Byte
660 lfFaceName[ELM(LF_FACESIZE)] As WCHAR
661End Type
662#ifdef UNICODE
663TypeDef LOGFONT = LOGFONTW
664#else
665TypeDef LOGFONT = LOGFONTA
666#endif
667Declare Function CreateFontIndirectA Lib "gdi32" (ByRef lf As LOGFONTA) As HFONT
668Declare Function CreateFontIndirect Lib "gdi32" Alias _FuncName_CreateFontIndirect (ByRef lf As LOGFONT) As HFONT
669
670Declare Function CreateHatchBrush Lib "gdi32" (fnStyle As Long, clrref As COLORREF) As HBRUSH
671Declare Function CreatePatternBrush Lib "gdi32" (hbmp As HBITMAP) As HBRUSH
672
673Const PS_SOLID = 0
674Const PS_DASH = 1
675Const PS_DOT = 2
676Const PS_DASHDOT = 3
677Const PS_DASHDOTDOT = 4
678Const PS_NULL = 5
679Const PS_INSIDEFRAME = 6
680Const PS_USERSTYLE = 7
681Const PS_ALTERNATE = 8
682Declare Function CreatePen Lib "gdi32" (nPenStyle As Long, nWidth As Long, crColor As COLORREF) As HPEN
683
684Type LOGPEN
685 lopnStyle As DWord
686 lopnWidth As POINTAPI
687 lopnColor As COLORREF
688End Type
689Declare Function CreatePenIndirect Lib "gdi32" (ByRef lplgpn As LOGPEN) As HPEN
690
691Declare Function CreatePolygonRgn Lib "gdi32" (ByRef lpPoints As POINTAPI, cPoints As Long, fnPolyFillMode As Long) As HRGN
692Declare Function CreateRectRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN
693Declare Function CreateRectRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN
694Declare Function CreateRoundRectRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long, nWidthEllipse As Long, nHeightEllipse As Long) As HRGN
695Declare Function CreateSolidBrush Lib "gdi32" (crColor As COLORREF) As HBRUSH
696Declare Function DeleteDC Lib "gdi32" (hdc As HDC) As BOOL
697Declare Function DeleteEnhMetaFile Lib "gdi32" (hemf As HENHMETAFILE) As BOOL
698Declare Function DeleteMetaFile Lib "gdi32" (hmf As HMETAFILE) As BOOL
699Declare Function DeleteObject Lib "gdi32" (hObject As HANDLE) As BOOL
700Declare Function DPtoLP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As BOOL
701Declare Function Ellipse Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, RightRect As Long, nBottomRect As Long) As BOOL
702Declare Function EndDoc Lib "gdi32" (hdc As HDC) As Long
703Declare Function EndPage Lib "gdi32" (hdc As HDC) As Long
704Declare Function EndPath Lib "gdi32" (hdc As HDC) As BOOL
705Declare Function EnumEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, pEnhMetaFunc As ENHMFENUMPROC, pData As VoidPtr, ByRef Rect As RECT) As BOOL
706Declare Function EnumMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE, pMetaFunc As MFENUMPROC, lParam As LPARAM) As BOOL
707Declare Function EqualRgn Lib "gdi32" (hSrcRgn1 As HRGN, hSrcRgn2 As HRGN) As BOOL
708Declare Function ExcludeClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
709
710Const FLOODFILLBORDER = 0
711Const FLOODFILLSURFACE = 1
712Declare Function ExtFloodFill Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, crColor As COLORREF, fuFillType As DWord) As BOOL
713
714Const PS_COSMETIC = &H00000000
715Const PS_GEOMETRIC = &H00010000
716Const PS_ENDCAP_ROUND = &H00000000
717Const PS_ENDCAP_SQUARE = &H00000100
718Const PS_ENDCAP_FLAT = &H00000200
719Const PS_JOIN_ROUND = &H00000000
720Const PS_JOIN_BEVEL = &H00001000
721Const PS_JOIN_MITER = &H00002000
722Declare Function ExtCreatePen Lib "gdi32" (dwPenStyle As DWord, dwWidth As DWord, ByRef lplb As LOGBRUSH, dwStyleCount As DWord, lpStyle As *DWord) As HPEN
723
724Declare Function ExtSelectClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, fnMode As Long) As Long
725Declare 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
726Declare 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
727#ifdef UNICODE
728Declare Function ExtTextOut Lib "gdi32" Alias "ExtTextOutW" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, lpString As PCTSTR, cbCount As Long, pDx As *Long) As Long
729#else
730Declare Function ExtTextOut Lib "gdi32" Alias "ExtTextOutA" (hdc As HDC, x As Long, y As Long, fuOptions As DWord, ByRef rc As RECT, lpString As PCTSTR, cbCount As Long, pDx As *Long) As Long
731#endif
732Declare Function FillPath Lib "gdi32" (hdc As HDC) As Long
733Declare Function FillRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH) As Long
734Declare Function FrameRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH, nWidth As Long, nHeight As Long) As Long
735Declare Function GdiComment Lib "gdi32" (hdc As HDC, cbSize As DWord, lpData As *Byte) As BOOL
736Declare Function GetBitmapBits Lib "gdi32" (hbmp As HBITMAP, cbBuffer As Long, lpvBits As VoidPtr) As Long
737Declare Function GetBkColor Lib "gdi32" (hdc As HDC) As DWord
738Declare Function GetBkMode Lib "gdi32" (hdc As HDC) As Long
739Declare Function GetBrushOrgEx Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI) As Long
740Declare Function GetCharWidth32 Lib "gdi32" Alias "GetCharWidth32A" (hdc As HDC, iFirstChar As Long, iLastChar As Long, lpBuffer As DWordPtr) As Long
741Declare Function GetClipBox Lib "gdi32" (hdc As HDC, ByRef lpRect As RECT) As Long
742Declare Function GetClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
743Declare Function GetCurrentObject Lib "gdi32" (hdc As HDC, dwObjectType As DWord) As HANDLE
744Declare Function GetCurrentPositionEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
745
746Const DRIVERVERSION = 0
747Const TECHNOLOGY = 2
748Const HORZSIZE = 4
749Const VERTSIZE = 6
750Const HORZRES = 8
751Const VERTRES = 10
752Const BITSPIXEL = 12
753Const PLANES = 14
754Const NUMBRUSHES = 16
755Const NUMPENS = 18
756Const NUMMARKERS = 20
757Const NUMFONTS = 22
758Const NUMCOLORS = 24
759Const PDEVICESIZE = 26
760Const CURVECAPS = 28
761Const LINECAPS = 30
762Const POLYGONALCAPS = 32
763Const TEXTCAPS = 34
764Const CLIPCAPS = 36
765Const RASTERCAPS = 38
766Const ASPECTX = 40
767Const ASPECTY = 42
768Const ASPECTXY = 44
769Const SHADEBLENDCAPS = 45
770Const LOGPIXELSX = 88
771Const LOGPIXELSY = 90
772Const SIZEPALETTE = 104
773Const NUMRESERVED = 106
774Const COLORRES = 108
775Const PHYSICALWIDTH = 110
776Const PHYSICALHEIGHT = 111
777Const PHYSICALOFFSETX = 112
778Const PHYSICALOFFSETY = 113
779Const SCALINGFACTORX = 114
780Const SCALINGFACTORY = 115
781Const VREFRESH = 116
782Const DESKTOPVERTRES = 117
783Const DESKTOPHORZRES = 118
784Const BLTALIGNMENT = 119
785Const DT_PLOTTER = 0 ' Device Technologies
786Const DT_RASDISPLAY = 1
787Const DT_RASPRINTER = 2
788Const DT_RASCAMERA = 3
789Const DT_CHARSTREAM = 4
790Const DT_METAFILE = 5
791Const DT_DISPFILE = 6
792Const CC_NONE = 0 ' Curve Capabilities
793Const CC_CIRCLES = 1
794Const CC_PIE = 2
795Const CC_CHORD = 4
796Const CC_ELLIPSES = 8
797Const CC_WIDE = 16
798Const CC_STYLED = 32
799Const CC_WIDESTYLED = 64
800Const CC_INTERIORS = 128
801Const CC_ROUNDRECT = 256
802Const LC_NONE = 0 ' Line Capabilities
803Const LC_POLYLINE = 2
804Const LC_MARKER = 4
805Const LC_POLYMARKER = 8
806Const LC_WIDE = 16
807Const LC_STYLED = 32
808Const LC_WIDESTYLED = 64
809Const LC_INTERIORS = 128
810Const PC_NONE = 0 ' Polygonal Capabilities
811Const PC_POLYGON = 1
812Const PC_RECTANGLE = 2
813Const PC_WINDPOLYGON = 4
814Const PC_TRAPEZOID = 4
815Const PC_SCANLINE = 8
816Const PC_WIDE = 16
817Const PC_STYLED = 32
818Const PC_WIDESTYLED = 64
819Const PC_INTERIORS = 128
820Const PC_POLYPOLYGON = 256
821Const PC_PATHS = 512
822Const CP_NONE = 0 ' Clipping Capabilities
823Const CP_RECTANGLE = 1
824Const CP_REGION = 2
825Const TC_OP_CHARACTER = &H00000001 ' Text Capabilities
826Const TC_OP_STROKE = &H00000002
827Const TC_CP_STROKE = &H00000004
828Const TC_CR_90 = &H00000008
829Const TC_CR_ANY = &H00000010
830Const TC_SF_X_YINDEP = &H00000020
831Const TC_SA_DOUBLE = &H00000040
832Const TC_SA_INTEGER = &H00000080
833Const TC_SA_CONTIN = &H00000100
834Const TC_EA_DOUBLE = &H00000200
835Const TC_IA_ABLE = &H00000400
836Const TC_UA_ABLE = &H00000800
837Const TC_SO_ABLE = &H00001000
838Const TC_RA_ABLE = &H00002000
839Const TC_VA_ABLE = &H00004000
840Const TC_RESERVED = &H00008000
841Const TC_SCROLLBLT = &H00010000
842Const RC_BITBLT = 1 ' Raster Capabilities
843Const RC_BANDING = 2
844Const RC_SCALING = 4
845Const RC_BITMAP64 = 8
846Const RC_GDI20_OUTPUT = &H0010
847Const RC_GDI20_STATE = &H0020
848Const RC_SAVEBITMAP = &H0040
849Const RC_DI_BITMAP = &H0080
850Const RC_PALETTE = &H0100
851Const RC_DIBTODEV = &H0200
852Const RC_BIGFONT = &H0400
853Const RC_STRETCHBLT = &H0800
854Const RC_FLOODFILL = &H1000
855Const RC_STRETCHDIB = &H2000
856Const RC_OP_DX_OUTPUT = &H4000
857Const RC_DEVBITS = &H8000
858Const SB_NONE = &H00000000 ' Shading and blending caps
859Const SB_CONST_ALPHA = &H00000001
860Const SB_PIXEL_ALPHA = &H00000002
861Const SB_PREMULT_ALPHA = &H00000004
862Const SB_GRAD_RECT = &H00000010
863Declare Function GetDeviceCaps Lib "gdi32" (hdc As HDC, nIndex As Long) As Long
864
865Declare 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
866Declare Function GetEnhMetaFile Lib "gdi32" Alias "GetEnhMetaFileA" (pszMetaFile As PCSTR) As HENHMETAFILE
867Declare Function GetEnhMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte) As DWord
868Declare Function GetEnhMetaFileDescription Lib "gdi32" Alias "GetEnhMetaFileDescriptionA" (hemf As HENHMETAFILE, cbBuffer As DWord, pszDescription As PTSTR) As DWord
869Declare Function GetEnhMetaFileHeader Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, ByRef emh As ENHMETAHEADER) As DWord
870Declare Function GetEnhMetaFilePaletteEntries Lib "gdi32" (hemf As HENHMETAFILE, cEntries As DWord, ByRef pe As PALETTEENTRY) As DWord
871
872Const MM_TEXT = 1
873Const MM_LOMETRIC = 2
874Const MM_HIMETRIC = 3
875Const MM_LOENGLISH = 4
876Const MM_HIENGLISH = 5
877Const MM_TWIPS = 6
878Const MM_ISOTROPIC = 7
879Const MM_ANISOTROPIC = 8
880Declare Function GetMapMode Lib "gdi32" (hdc As HDC) As Long
881Declare Function GetMetaFileBitsEx Lib "gdi32" (hmf As HMETAFILE, nSize As DWord, pvData As VoidPtr) As DWord
882Declare Function GetMiterLimit Lib "gdi32" (hdc As HDC, peLimit As SinglePtr) As Long
883Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (hgdiobj As HANDLE, cbBuffer As Long, ByRef lpvObject As Any) As Long
884Declare Function GetObjectType Lib "gdi32" (hObject As HANDLE) As Long
885
886Const PT_CLOSEFIGURE = &H01
887Const PT_LINETO = &H02
888Const PT_BEZIERTO = &H04
889Const PT_MOVETO = &H06
890Declare Function GetPath Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, lpTypes As BytePtr, nSize As Long) As Long
891
892Declare Function GetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long) As DWord
893Declare Function GetPolyFillMode Lib "gdi32" (hdc As HDC) As Long
894Declare Function GetRgnBox Lib "gdi32" (hRgn As HRGN, ByRef lpRect As RECT) As Long
895Declare Function GetROP2 Lib "gdi32" (hdc As HDC) As Long
896
897Const WHITE_BRUSH = 0
898Const LTGRAY_BRUSH = 1
899Const GRAY_BRUSH = 2
900Const DKGRAY_BRUSH = 3
901Const BLACK_BRUSH = 4
902Const NULL_BRUSH = 5
903Const HOLLOW_BRUSH = NULL_BRUSH
904Const WHITE_PEN = 6
905Const BLACK_PEN = 7
906Const NULL_PEN = 8
907Const OEM_FIXED_FONT = 10
908Const ANSI_FIXED_FONT = 11
909Const ANSI_VAR_FONT = 12
910Const SYSTEM_FONT = 13
911Const DEVICE_DEFAULT_FONT = 14
912Const DEFAULT_PALETTE = 15
913Const SYSTEM_FIXED_FONT = 16
914Declare Function GetStockObject Lib "gdi32" (fnObject As Long) As HANDLE
915
916Declare Function GetStretchBltMode Lib "gdi32" (hdc As HDC) As Long
917
918Const TA_NOUPDATECP = 0
919Const TA_UPDATECP = 1
920Const TA_LEFT = 0
921Const TA_RIGHT = 2
922Const TA_CENTER = 6
923Const TA_TOP = 0
924Const TA_BOTTOM = 8
925Const TA_BASELINE = 24
926Const TA_RTLREADING = 256
927Declare Function GetTextAlign Lib "gdi32" (hdc As HDC) As DWord
928
929Declare Function GetTextColor Lib "gdi32" (hdc As HDC) As DWord
930Declare Function GetTextExtentPoint32A Lib "gdi32" (hdc As HDC, pString As PCSTR, cbString As Long, ByRef Size As SIZE) As Long
931Declare Function GetTextExtentPoint32W Lib "gdi32" (hdc As HDC, pString As PCWSTR, cbString As Long, ByRef Size As SIZE) As Long
932#ifdef UNICODE
933Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32W" (hdc As HDC, pString As PCTSTR, cbString As Long, ByRef Size As SIZE) As Long
934#else
935Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (hdc As HDC, pString As PCTSTR, cbString As Long, ByRef Size As SIZE) As Long
936#endif
937
938Const TMPF_FIXED_PITCH = &H01
939Const TMPF_VECTOR = &H02
940Const TMPF_DEVICE = &H08
941Const TMPF_TRUETYPE = &H04
942Type TEXTMETRIC
943 tmHeight As Long
944 tmAscent As Long
945 tmDescent As Long
946 tmInternalLeading As Long
947 tmExternalLeading As Long
948 tmAveCharWidth As Long
949 tmMaxCharWidth As Long
950 tmWeight As Long
951 tmOverhang As Long
952 tmDigitizedAspectX As Long
953 tmDigitizedAspectY As Long
954 tmFirstChar As Byte
955 tmLastChar As Byte
956 tmDefaultChar As Byte
957 tmBreakChar As Byte
958 tmItalic As Byte
959 tmUnderlined As Byte
960 tmStruckOut As Byte
961 tmPitchAndFamily As Byte
962 tmCharSet As Byte
963End Type
964Declare Function GetTextMetrics Lib "gdi32" Alias "GetTextMetricsA" (hdc As HDC, ByRef lptm As TEXTMETRIC) As Long
965
966Declare Function GetViewportExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
967Declare Function GetViewportOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
968Declare Function GetWindowExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long
969Declare Function GetWindowOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long
970Declare Function GetWinMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte, fnMapMode As Long, hdcRef As HDC) As DWord
971Declare Function IntersectClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
972Declare Function InvertRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
973Declare Function LineTo Lib "gdi32" (hdc As HDC, nXEnd As Long, nYEnd As Long) As Long
974Declare Function LPtoDP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As Long
975Declare Function MoveToEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
976Declare Function OffsetRgn Lib "gdi32" (hRgn As HRGN, nXOffset As Long, nYOffset As Long) As Long
977Declare Function OffsetClipRgn Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long) As Long
978Declare Function OffsetViewportOrgEx Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long, ByRef lpPoint As POINTAPI) As Long
979Declare Function OffsetWindowOrgEx Lib "gdi32" (hdc As HDC, nXOffset As Long, nYOffset As Long, ByRef lpPoint As POINTAPI) As Long
980Declare Function PaintRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
981Declare Function PatBlt Lib "gdi32" (hdc As HDC, nXLeft As Long, nYLeft As Long, nWidth As Long, nHeight As Long, dwRop As DWord) As Long
982Declare Function PathToRegion Lib "gdi32" (hdc As HDC) As HRGN
983Declare 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
984Declare Function PlayEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, ByRef Rect As RECT) As Long
985Declare Function PlayEnhMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef EnhMetaRecord As ENHMETARECORD, nHandles As DWord) As BOOL
986Declare Function PlayMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE) As BOOL
987Declare Function PlayMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef MetaRecord As METARECORD, nHandles As DWord) As BOOL
988Declare 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
989Declare Function PolyBezier Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
990Declare Function PolyBezierTo Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
991Declare Function Polygon Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, cPoints As Long) As Long
992Declare Function Polyline Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
993Declare Function PolylineTo Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long
994Declare Function PtInRegion Lib "gdi32" (hRgn As HRGN, x As Long, y As Long) As Long
995Declare Function PtVisible Lib "gdi32" (hdc As HDC, x As Long, y As Long) As Long
996Declare Function RealizePalette Lib "gdi32" (hdc As HDC) As Long
997Declare Function Rectangle Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
998Declare Function RectInRegion Lib "gdi32" (hRgn As HRGN, ByRef lpRect As RECT) As Long
999Declare Function RectVisible Lib "gdi32" (hdc As HDC, ByRef lpRect As RECT) As Long
1000Declare Function ResetDC Lib "gdi32" Alias "ResetDCA" (hdc As HDC, ByRef lpInitData As DEVMODE) As HDC
1001Declare Function RestoreDC Lib "gdi32" (hdc As HDC, nSavedDC As Long) As Long
1002Declare 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
1003Declare Function SaveDC Lib "gdi32" (hdc As HDC) As Long
1004Declare 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
1005Declare 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
1006Declare Function SelectClipPath Lib "gdi32" (hdc As HDC, iMode As Long) As Long
1007Declare Function SelectClipRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long
1008Declare Function SelectObject Lib "gdi32" (hdc As HDC, hObject As HANDLE) As HANDLE
1009Declare Function SelectPalette Lib "gdi32" (hdc As HDC, hpal As HPALETTE, bForceBackground As BOOL) As HPALETTE
1010Declare Function SetBkColor Lib "gdi32" (hdc As HDC, crColor As DWord) As DWord
1011
1012Const TRANSPARENT = 1
1013Const OPAQUE = 2
1014Declare Function SetBkMode Lib "gdi32" (hdc As HDC, iBkMode As Long) As Long
1015
1016Declare Function SetBrushOrgEx Lib "gdi32" (hdc As HDC, nXOrg As Long, nYOrg As Long, ByRef lppt As POINTAPI) As Long
1017Declare 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
1018Declare Function SetEnhMetaFileBits Lib "gdi32" (cbBuffer As DWord, pData As *Byte) As HENHMETAFILE
1019Declare Function SetMapMode Lib "gdi32" (hdc As HDC, fnMapMode As Long) As Long
1020Declare Function SetMetaFileBitsEx Lib "gdi32" (nSize As DWord, pData As *Byte) As HMETAFILE
1021Declare Function SetMiterLimit Lib "gdi32" (hdc As HDC, eNewLimit As Single, peOldLimit As SinglePtr) As Long
1022Declare Function SetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long, crColor As DWord) As DWord
1023Declare Function SetPolyFillMode Lib "gdi32" (hdc As HDC, iPolyFillMode As Long) As Long
1024Declare Function SetRectRgn Lib "gdi32" (hRgn As HRGN, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long
1025Declare Function SetROP2 Lib "gdi32" (hdc As HDC, fnDrawMode As Long) As Long
1026
1027Const BLACKONWHITE = 1
1028Const WHITEONBLACK = 2
1029Const COLORONCOLOR = 3
1030Const HALFTONE = 4
1031Const STRETCH_ANDSCANS = BLACKONWHITE
1032Const STRETCH_ORSCANS = WHITEONBLACK
1033Const STRETCH_DELETESCANS = COLORONCOLOR
1034Const STRETCH_HALFTONE = HALFTONE
1035Declare Function SetStretchBltMode Lib "gdi32" (hdc As HDC, iStretchMode As Long) As Long
1036
1037Declare Function SetTextAlign Lib "gdi32" (hdc As HDC, fMode As DWord) As DWord
1038Declare Function SetTextColor Lib "gdi32" (hdc As HDC, crColor As DWord) As DWord
1039Declare Function SetViewportExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
1040Declare Function SetViewportOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1041Declare Function SetWindowExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long
1042Declare Function SetWindowOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long
1043Declare Function SetWinMetaFileBits Lib "gdi32" (cbBuffer As DWord, pbBuffer As *Byte, hdcRef As HDC, ByRef mfp As METAFILEPICT) As HENHMETAFILE
1044Declare Function StartDoc Lib "gdi32" Alias "StartDocA" (hdc As HDC, ByRef ref_di As DOCINFO) As Long
1045Declare Function StartPage Lib "gdi32" (hdc As HDC) As Long
1046Declare 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
1047Declare 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
1048Declare Function StrokeAndFillPath Lib "gdi32" (hdc As HDC) As Long
1049Declare Function StrokePath Lib "gdi32" (DC As DWord) As Long
1050Declare Function TextOutA Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCSTR, cbString As Long) As Long
1051Declare Function TextOutW Lib "gdi32" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCWSTR, cbString As Long) As Long
1052#ifdef UNICODE
1053Declare Function TextOut Lib "gdi32" Alias "TextOutW" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCTSTR, cbString As Long) As Long
1054#else
1055Declare Function TextOut Lib "gdi32" Alias "TextOutA" (hdc As HDC, nXStart As Long, nYStart As Long, pString As PCTSTR, cbString As Long) As Long
1056#endif
1057
1058/* Pixel Format */
1059Type PIXELFORMATDESCRIPTOR
1060 nSize As Word
1061 nVersion As Word
1062 dwFlags As DWord
1063 iPixelType As Byte
1064 cColorBits As Byte
1065 cRedBits As Byte
1066 cRedShift As Byte
1067 cGreenBits As Byte
1068 cGreenShift As Byte
1069 cBlueBits As Byte
1070 cBlueShift As Byte
1071 cAlphaBits As Byte
1072 cAlphaShift As Byte
1073 cAccumBits As Byte
1074 cAccumRedBits As Byte
1075 cAccumGreenBits As Byte
1076 cAccumBlueBits As Byte
1077 cAccumAlphaBits As Byte
1078 cDepthBits As Byte
1079 cStencilBits As Byte
1080 cAuxBuffers As Byte
1081 iLayerType As Byte
1082 bReserved As Byte
1083 dwLayerMask As DWord
1084 dwVisibleMask As DWord
1085 dwDamageMask As DWord
1086End Type
1087TypeDef PPIXELFORMATDESCRIPTOR = *PIXELFORMATDESCRIPTOR
1088TypeDef LPPIXELFORMATDESCRIPTOR = *PIXELFORMATDESCRIPTOR
1089
1090Const PFD_TYPE_RGBA = 0
1091Const PFD_TYPE_COLORINDEX = 1
1092
1093Const PFD_MAIN_PLANE = 0
1094Const PFD_OVERLAY_PLANE = 1
1095Const PFD_UNDERLAY_PLANE = (-1)
1096
1097Const PFD_DOUBLEBUFFER = &H00000001
1098Const PFD_STEREO = &H00000002
1099Const PFD_DRAW_TO_WINDOW = &H00000004
1100Const PFD_DRAW_TO_BITMAP = &H00000008
1101Const PFD_SUPPORT_GDI = &H00000010
1102Const PFD_SUPPORT_OPENGL = &H00000020
1103Const PFD_GENERIC_FORMAT = &H00000040
1104Const PFD_NEED_PALETTE = &H00000080
1105Const PFD_NEED_SYSTEM_PALETTE = &H00000100
1106Const PFD_SWAP_EXCHANGE = &H00000200
1107Const PFD_SWAP_COPY = &H00000400
1108Const PFD_SWAP_LAYER_BUFFERS = &H00000800
1109Const PFD_GENERIC_ACCELERATED = &H00001000
1110Const PFD_SUPPORT_DIRECTDRAW = &H00002000
1111
1112Const PFD_DEPTH_DONTCARE = &H20000000
1113Const PFD_DOUBLEBUFFER_DONTCARE = &H40000000
1114Const PFD_STEREO_DONTCARE = &H80000000
1115
1116Declare Function ChoosePixelFormat Lib "gdi32" (hdc As HDC, ByRef lppfd As PIXELFORMATDESCRIPTOR) As Long
1117Declare Function DescribePixelFormat Lib "gdi32" (hdc As HDC, n As Long, u As DWord, ByRef lppfd As PIXELFORMATDESCRIPTOR) As Long
1118Declare Function GetPixelFormat Lib "gdi32" (hdc As HDC) As Long
1119Declare Function SetPixelFormat Lib "gdi32" (hdc As HDC, i As Long, ByRef lppfd As PIXELFORMATDESCRIPTOR) As BOOL
1120
1121
1122/* OpenGL Support */
1123Type _System_DeclareHandle_HGLRC:unused As DWord:End Type
1124TypeDef HGLRC = *_System_DeclareHandle_HGLRC
1125
1126Declare Function wglCopyContext Lib "opengl32" (hglrcSource As HGLRC, hglrcDest As HGLRC, mask As DWord) As BOOL
1127Declare Function wglCreateContext Lib "opengl32" (hdc As HDC) As HGLRC
1128Declare Function wglCreateLayerContext Lib "opengl32" (hdc As HDC, iLayerPlane As Long) As HGLRC
1129Declare Function wglDeleteContext Lib "opengl32" (hglrc As HGLRC) As BOOL
1130Declare Function wglGetCurrentContext Lib "opengl32" () As HGLRC
1131Declare Function wglGetCurrentDC Lib "opengl32" () As HDC
1132Declare Function wglGetProcAddress Lib "opengl32" (lpstr As LPSTR) As PROC
1133Declare Function wglMakeCurrent Lib "opengl32" (hdc As HDC, hglrc As HGLRC) As BOOL
1134Declare Function wglShareLists Lib "opengl32" (hglrc1 As HGLRC, hglrc2 As HGLRC) As BOOL
1135Declare Function wglUseFontBitmaps Lib "opengl32" Alias "wglUseFontBitmapsA" (hdc As HDC, first As DWord, count As DWord, listbase As DWord) As BOOL
1136Declare Function SwapBuffers Lib "gdi32" (hdc As HDC) As BOOL
1137
1138Type POINTFLOAT
1139 x As Single
1140 y As Single
1141End Type
1142TypeDef PPOINTFLOAT = *POINTFLOAT
1143
1144Type GLYPHMETRICSFLOAT
1145 gmfBlackBoxX As Single
1146 gmfBlackBoxY As Single
1147 gmfptGlyphOrigin As POINTFLOAT
1148 gmfCellIncX As Single
1149 gmfCellIncY As Single
1150End Type
1151TypeDef PGLYPHMETRICSFLOAT = *GLYPHMETRICSFLOAT
1152TypeDef LPGLYPHMETRICSFLOAT = *GLYPHMETRICSFLOAT
1153
1154Const WGL_FONT_LINES = 0
1155Const WGL_FONT_POLYGONS = 1
1156
1157Declare Function wglUseFontOutlines Lib "opengl32" Alias "wglUseFontOutlinesA" (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
1158
1159Type LAYERPLANEDESCRIPTOR
1160 nSize As Word
1161 nVersion As Word
1162 dwFlags As DWord
1163 iPixelType As Byte
1164 cColorBits As Byte
1165 cRedBits As Byte
1166 cRedShift As Byte
1167 cGreenBits As Byte
1168 cGreenShift As Byte
1169 cBlueBits As Byte
1170 cBlueShift As Byte
1171 cAlphaBits As Byte
1172 cAlphaShift As Byte
1173 cAccumBits As Byte
1174 cAccumRedBits As Byte
1175 cAccumGreenBits As Byte
1176 cAccumBlueBits As Byte
1177 cAccumAlphaBits As Byte
1178 cDepthBits As Byte
1179 cStencilBits As Byte
1180 cAuxBuffers As Byte
1181 iLayerPlane As Byte
1182 bReserved As Byte
1183 crTransparent As COLORREF
1184End Type
1185TypeDef PLAYERPLANEDESCRIPTOR = *LAYERPLANEDESCRIPTOR
1186TypeDef LPLAYERPLANEDESCRIPTOR = *LAYERPLANEDESCRIPTOR
1187
1188Const LPD_DOUBLEBUFFER = &H00000001
1189Const LPD_STEREO = &H00000002
1190Const LPD_SUPPORT_GDI = &H00000010
1191Const LPD_SUPPORT_OPENGL = &H00000020
1192Const LPD_SHARE_DEPTH = &H00000040
1193Const LPD_SHARE_STENCIL = &H00000080
1194Const LPD_SHARE_ACCUM = &H00000100
1195Const LPD_SWAP_EXCHANGE = &H00000200
1196Const LPD_SWAP_COPY = &H00000400
1197Const LPD_TRANSPARENT = &H00001000
1198Const LPD_TYPE_RGBA = 0
1199Const LPD_TYPE_COLORINDEX = 1
1200
1201Const WGL_SWAP_MAIN_PLANE = &H00000001
1202Const WGL_SWAP_OVERLAY1 = &H00000002
1203Const WGL_SWAP_OVERLAY2 = &H00000004
1204Const WGL_SWAP_OVERLAY3 = &H00000008
1205Const WGL_SWAP_OVERLAY4 = &H00000010
1206Const WGL_SWAP_OVERLAY5 = &H00000020
1207Const WGL_SWAP_OVERLAY6 = &H00000040
1208Const WGL_SWAP_OVERLAY7 = &H00000080
1209Const WGL_SWAP_OVERLAY8 = &H00000100
1210Const WGL_SWAP_OVERLAY9 = &H00000200
1211Const WGL_SWAP_OVERLAY10 = &H00000400
1212Const WGL_SWAP_OVERLAY11 = &H00000800
1213Const WGL_SWAP_OVERLAY12 = &H00001000
1214Const WGL_SWAP_OVERLAY13 = &H00002000
1215Const WGL_SWAP_OVERLAY14 = &H00004000
1216Const WGL_SWAP_OVERLAY15 = &H00008000
1217Const WGL_SWAP_UNDERLAY1 = &H00010000
1218Const WGL_SWAP_UNDERLAY2 = &H00020000
1219Const WGL_SWAP_UNDERLAY3 = &H00040000
1220Const WGL_SWAP_UNDERLAY4 = &H00080000
1221Const WGL_SWAP_UNDERLAY5 = &H00100000
1222Const WGL_SWAP_UNDERLAY6 = &H00200000
1223Const WGL_SWAP_UNDERLAY7 = &H00400000
1224Const WGL_SWAP_UNDERLAY8 = &H00800000
1225Const WGL_SWAP_UNDERLAY9 = &H01000000
1226Const WGL_SWAP_UNDERLAY10 = &H02000000
1227Const WGL_SWAP_UNDERLAY11 = &H04000000
1228Const WGL_SWAP_UNDERLAY12 = &H08000000
1229Const WGL_SWAP_UNDERLAY13 = &H10000000
1230Const WGL_SWAP_UNDERLAY14 = &H20000000
1231Const WGL_SWAP_UNDERLAY15 = &H40000000
1232
1233Declare Function wglDescribeLayerPlane Lib "opengl32" (hdc As HDC, iPixelFormat As Long, iLayerPlane As Long, nByte As DWord, ByRef lplpd As LAYERPLANEDESCRIPTOR) As BOOL
1234Declare Function wglSetLayerPaletteEntries Lib "opengl32" (hdc As HDC, iLayerPlane As Long, iStart As Long, cEntries As Long, lpcr As *COLORREF) As Long
1235Declare Function wglGetLayerPaletteEntries Lib "opengl32" (hdc As HDC, iLayerPlane As Long, iStart As Long, cEntries As Long, lpcr As *COLORREF) As Long
1236Declare Function wglRealizeLayerPalette Lib "opengl32" (hdc As HDC, iLayerPlane As Long, bRealize As BOOL) As BOOL
1237Declare Function wglSwapLayerBuffers Lib "opengl32" (hdc As HDC, fuPlanes As DWord) As BOOL
1238
1239Type WGLSWAP
1240 hdc As HDC
1241 uiFlags As DWord
1242End Type
1243TypeDef PWGLSWAP = *WGLSWAP
1244TypeDef LPWGLSWAP = *WGLSWAP
1245
1246Const WGL_SWAPMULTIPLE_MAX = 16
1247
1248'Declare Function wglSwapMultipleBuffers Lib "opengl32" (u As DWord, lpwglswap As *WGLSWAP) As DWord
1249
1250#endif '_INC_GDI
Note: See TracBrowser for help on using the repository browser.