Changeset 123 for Include/api_gdi.sbp
- Timestamp:
- Mar 1, 2007, 12:31:13 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/api_gdi.sbp
r121 r123 9 9 Const GDI_ERROR = &HFFFFFFFF 10 10 11 TypeDef BCHAR = TBYTE 11 12 12 13 Type _System_DeclareHandle_HPALETTE:unused As DWord:End Type 13 14 TypeDef HPALETTE = *_System_DeclareHandle_HPALETTE 14 15 15 16 16 ' Point/Rectangle/Size struct … … 30 30 cx As Long 31 31 cy As Long 32 End Type 33 34 ' Metafile and EnhancedMetafile 35 Type EMR 36 iType As DWord 37 nSize As DWord 32 38 End Type 33 39 … … 43 49 TypeDef PMETAHEADER = *METAHEADER 44 50 51 Type ENHMETAHEADER 52 iType As DWord 53 nSize As DWord 54 rclBounds As RECT 55 rclFrame As RECT 56 dSignature As DWord 57 nVersion As DWord 58 nBytes As DWord 59 nRecords As DWord 60 nHandles As Word 61 sReserved As Word 62 nDescription As DWord 63 offDescription As DWord 64 nPalEntries As DWord 65 szlDevice As SIZE 66 szlMillimeters As SIZE 67 cbPixelFormat As DWord 68 offPixelFormat As DWord 69 bOpenGL As DWord 70 '#if WINVER >= 0x0500 71 'szlMicrometers As SIZE 72 '#endif 73 End Type 74 TypeDef PENHMETAHEADER = *ENHMETAHEADER 75 76 Type HANDLETABLE 77 objectHandle[ELM(1)] As HGDIOBJ 78 End Type 79 80 Type METARECORD 81 rdSize As DWord 82 rdFunction As Word 83 rdParm[ELM(1)] As Word 84 End Type 85 86 Type ENHMETARECORD 87 iType As DWord 88 nSize As DWord 89 dParm[ELM(1)] As DWord 90 End Type 91 92 Type METAFILEPICT 93 mm As Long 94 xExt As Long 95 yExt As Long 96 hMF As HMETAFILE 97 End Type 98 99 TypeDef ENHMFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef EMFR As ENHMETARECORD, nObj As Long, lpData As LPARAM) As Long 100 TypeDef MFENUMPROC = *Function(hdc As HDC, ByRef HTable As HANDLETABLE, ByRef MFR As METARECORD, nObj As Long, lpClientData As LPARAM) 101 102 103 ' RGB Color 45 104 Const RGB(r, g, b) = ((r) As Long) Or (((g) As Long) <<8) Or (((b) As Long) <<16) 105 Const PALETTERGB(r, g, b) = (&h02000000 Or RGB(r,g,b)) 106 Const PALETTEINDEX(i) = ((&h01000000 Or (i) As Word As DWord) As COLORREF) 107 46 108 Const GetRValue(rgb) = (rgb And &hff) 47 109 Const GetGValue(rgb) = ((rgb >> 8) And &hff) … … 54 116 rgbReserved As Byte 55 117 End Type 118 119 Type Align(1) RGBTRIPLE 120 rgbtBlue As Byte 121 rgbtGreen As Byte 122 rgbtRed As Byte 123 End Type 124 125 ' CMYK Color 126 Const GetKValue(cmyk) = ((cmyk) As Byte) 127 Const GetYValue(cmyk) = (((cmyk) >> 8) As Byte) 128 Const GetMValue(cmyk) = (((cmyk) >> 16) As Byte) 129 Const GetCValue(cmyk) = (((cmyk) >> 24) As Byte) 130 131 Const CMYK(c, m, y, k) = (( _ 132 ((k) As Byte) Or _ 133 ((y) As Byte As Word << 8) Or _ 134 ((m) As Byte As DWord << 16) Or _ 135 ((c) As Byte As DWord << 24)) As COLORREF) 136 137 ' ICM Color 138 TypeDef FXPT16DOT16 = Long 139 TypeDef FXPT2DOT30 = Long 140 141 TypeDef LCSCSTYPE = Long 142 TypeDef LCSGAMUTMATCH = Long 143 144 Type LOGCOLORSPACEA 145 lcsSignature As DWord 146 lcsVersion As DWord 147 lcsSize As DWord 148 lcsCSType As LCSCSTYPE 149 lcsIntent As LCSGAMUTMATCH 150 lcsEndpoints As CIEXYZTRIPLE 151 lcsGammaRed As DWord 152 lcsGammaGreen As DWord 153 lcsGammaBlue As DWord 154 lcsFilename[MAX_PATH] As SByte 155 End Type 156 Type LOGCOLORSPACEW 157 lcsSignature As DWord 158 lcsVersion As DWord 159 lcsSize As DWord 160 lcsCSType As LCSCSTYPE 161 lcsIntent As LCSGAMUTMATCH 162 lcsEndpoints As CIEXYZTRIPLE 163 lcsGammaRed As DWord 164 lcsGammaGreen As DWord 165 lcsGammaBlue As DWord 166 lcsFilename[ELM(MAX_PATH)] As WCHAR 167 End Type 168 #ifdef UNICODE 169 TypeDef LOGCOLORSPACE = LOGCOLORSPACEW 170 #else 171 TypeDef LOGCOLORSPACE = LOGCOLORSPACEA 172 #endif 173 174 Type CIEXYZ 175 ciexyzX As FXPT2DOT30 176 ciexyzY As FXPT2DOT30 177 ciexyzZ As FXPT2DOT30 178 End Type 179 180 Type CIEXYZTRIPLE 181 ciexyzRed As CIEXYZ 182 ciexyzGreen As CIEXYZ 183 ciexyzBlue As CIEXYZ 184 End Type 185 56 186 57 187 … … 101 231 End Type 102 232 233 Type BITMAPCOREHEADER 234 bcSize As DWord 235 bcWidth As Word 236 bcHeight As Word 237 bcPlanes As Word 238 bcBitCount As Word 239 End Type 240 241 Type BITMAPCOREINFO 242 bmciHeader As BITMAPCOREHEADER 243 bmciColors[ELM(1)] As RGBTRIPLE 244 End Type 103 245 104 246 ' structures for defining DIBs … … 109 251 Const BI_JPEG = 4 110 252 Const BI_PNG = 5 253 111 254 Type BITMAPINFOHEADER 112 255 biSize As DWord … … 122 265 biClrImportant As DWord 123 266 End Type 267 124 268 Type BITMAPINFO 125 269 bmiHeader As BITMAPINFOHEADER 126 bm pColors[255] As RGBQUAD270 bmiColors[ELM(1)] As RGBQUAD '以前はbmpColors[255] As RGBQUADだったことに注意 127 271 End Type 128 272 … … 137 281 End Type 138 282 283 Type BITMAPV4HEADER 284 bV4Size As DWord 285 bV4Width As Long 286 bV4Height As Long 287 bV4Planes As Word 288 bV4BitCount As Word 289 bV4V4Compression As DWord 290 bV4SizeImage As DWord 291 bV4XPelsPerMeter As Long 292 bV4YPelsPerMeter As Long 293 bV4ClrUsed As DWord 294 bV4ClrImportant As DWord 295 bV4RedMask As DWord 296 bV4GreenMask As DWord 297 bV4BlueMask As DWord 298 bV4AlphaMask As DWord 299 bV4CSType As DWord 300 bV4Endpoints As CIEXYZTRIPLE 301 bV4GammaRed As DWord 302 bV4GammaGreen As DWord 303 bV4GammaBlue As DWord 304 End Type 139 305 140 306 ' Region flags … … 327 493 Declare Function CancelDC Lib "gdi32" (hdc As HDC) As BOOL 328 494 Declare 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 495 Declare Function CloseEnhMetaFile Lib "gdi32" (hdc As HDC) As HENHMETAFILE 329 496 Declare Function CloseFigure Lib "gdi32" (hdc As HDC) As BOOL 497 Declare Function CloseMetaFile Lib "gdi32" (hdc As HDC) As HMETAFILE 330 498 331 499 Const RGN_AND = 1 … … 335 503 Const RGN_COPY = 5 336 504 Declare Function CombineRgn Lib "gdi32" (hrgnDest As HRGN, hrgnSrc1 As HRGN, hrgnSrc2 As HRGN, fnCombineMode As Long) As Long 337 505 Declare Function CopyEnhMetaFile Lib "gdi32" Alias "CopyEnhMetaFileA" (hemfSrc As HENHMETAFILE, pszFile As PCSTR) As HENHMETAFILE 506 Declare Function CopyMetaFile Lib "gdi32" Alias "CopyMetaFileA" (hmfSrc As HMETAFILE, pszFile As PCSTR) As HMETAFILE 338 507 Declare Function CreateBitmap Lib "gdi32" (nWidth As Long, nHeight As Long, cPlanes As Long, cBitsPerPel As Long, lpvBits As VoidPtr) As HBITMAP 339 508 Declare Function CreateBitmapIndirect Lib "gdi32" (ByRef lpbm As BITMAP) As HBITMAP … … 376 545 Declare Function CreateEllipticRgn Lib "gdi32" (nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As HRGN 377 546 Declare Function CreateEllipticRgnIndirect Lib "gdi32" (ByRef lpRect As RECT) As HRGN 547 Declare Function CreateEnhMetaFile Lib "gdi32" Alias "CreateEnhMetaFileA" (hdcRef As HDC, pFileName As PCTSTR, ByRef Rect As RECT, pDescription As PCTSTR) As HDC 548 Declare Function CreateMetaFile Lib "gdi32" Alias "CreateMetaFileA" (pFileName As PCTSTR) As HDC 378 549 379 550 Const FW_DONTCARE = 0 … … 518 689 Declare Function CreateSolidBrush Lib "gdi32" (crColor As COLORREF) As HBRUSH 519 690 Declare Function DeleteDC Lib "gdi32" (hdc As HDC) As BOOL 691 Declare Function DeleteEnhMetaFile Lib "gdi32" (hemf As HENHMETAFILE) As BOOL 692 Declare Function DeleteMetaFile Lib "gdi32" (hmf As HMETAFILE) As BOOL 520 693 Declare Function DeleteObject Lib "gdi32" (hObject As HANDLE) As BOOL 521 694 Declare Function DPtoLP Lib "gdi32" (hdc As HDC, ByRef lpPoints As POINTAPI, nCount As Long) As BOOL … … 524 697 Declare Function EndPage Lib "gdi32" (hdc As HDC) As Long 525 698 Declare Function EndPath Lib "gdi32" (hdc As HDC) As BOOL 699 Declare Function EnumEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, pEnhMetaFunc As ENHMFENUMPROC, pData As VoidPtr, ByRef Rect As RECT) As BOOL 700 Declare Function EnumMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE, pMetaFunc As MFENUMPROC, lParam As LPARAM) As BOOL 526 701 Declare Function EqualRgn Lib "gdi32" (hSrcRgn1 As HRGN, hSrcRgn2 As HRGN) As BOOL 527 702 Declare Function ExcludeClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long … … 552 727 Declare Function FillRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH) As Long 553 728 Declare Function FrameRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN, hBrush As HBRUSH, nWidth As Long, nHeight As Long) As Long 554 Declare Function GetBitmapBits Lib "gdi32" (hbmp As HBITMAP, cbBuffer As Long, lpvBits As VoidPtr) As Long 729 Declare Function GdiComment Lib "gdi32" (hdc As HDC, cbSize As DWord, lpData As *Byte) As BOOL 730 Declare Function GetBitmapBits Lib "gdi32" (hbmp As HBITMAP, cbBuffer As Long, lpvBits As VoidPtr) As Long 555 731 Declare Function GetBkColor Lib "gdi32" (hdc As HDC) As DWord 556 732 Declare Function GetBkMode Lib "gdi32" (hdc As HDC) As Long … … 682 858 683 859 Declare 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 860 Declare Function GetEnhMetaFile Lib "gdi32" Alias "GetEnhMetaFileA" (pszMetaFile As PCSTR) As HENHMETAFILE 861 Declare Function GetEnhMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte) As DWord 862 Declare Function GetEnhMetaFileDescription Lib "gdi32" Alias "GetEnhMetaFileDescriptionA" (hemf As HENHMETAFILE, cbBuffer As DWord, pszDescription As PTSTR) As DWord 863 Declare Function GetEnhMetaFileHeader Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, ByRef emh As ENHMETAHEADER) As DWord 864 Declare Function GetEnhMetaFilePaletteEntries Lib "gdi32" (hemf As HENHMETAFILE, cEntries As DWord, ByRef pe As PALETTEENTRY) As DWord 684 865 685 866 Const MM_TEXT = 1 … … 692 873 Const MM_ANISOTROPIC = 8 693 874 Declare Function GetMapMode Lib "gdi32" (hdc As HDC) As Long 694 875 Declare Function GetMetaFileBitsEx Lib "gdi32" (hmf As HMETAFILE, nSize As DWord, pvData As VoidPtr) As DWord 695 876 Declare Function GetMiterLimit Lib "gdi32" (hdc As HDC, peLimit As SinglePtr) As Long 696 877 Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (hgdiobj As HANDLE, cbBuffer As Long, ByRef lpvObject As Any) As Long … … 781 962 Declare Function GetWindowExtEx Lib "gdi32" (hdc As HDC, ByRef lpSize As SIZE) As Long 782 963 Declare Function GetWindowOrgEx Lib "gdi32" (hdc As HDC, ByRef lpPoint As POINTAPI) As Long 964 Declare Function GetWinMetaFileBits Lib "gdi32" (hemf As HENHMETAFILE, cbBuffer As DWord, pbBuffer As *Byte, fnMapMode As Long, hdcRef As HDC) As DWord 783 965 Declare Function IntersectClipRect Lib "gdi32" (hdc As HDC, nLeftRect As Long, nTopRect As Long, nRightRect As Long, nBottomRect As Long) As Long 784 966 Declare Function InvertRgn Lib "gdi32" (hdc As HDC, hRgn As HRGN) As Long … … 794 976 Declare Function PathToRegion Lib "gdi32" (hdc As HDC) As HRGN 795 977 Declare 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 978 Declare Function PlayEnhMetaFile Lib "gdi32" (hdc As HDC, hemf As HENHMETAFILE, ByRef Rect As RECT) As Long 979 Declare Function PlayEnhMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef EnhMetaRecord As ENHMETARECORD, nHandles As DWord) As BOOL 980 Declare Function PlayMetaFile Lib "gdi32" (hdc As HDC, hmf As HMETAFILE) As BOOL 981 Declare Function PlayMetaFileRecord Lib "gdi32" (hdc As HDC, ByRef Handletable As HANDLETABLE, ByRef MetaRecord As METARECORD, nHandles As DWord) As BOOL 796 982 Declare 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 797 983 Declare Function PolyBezier Lib "gdi32" (hdc As HDC, ByRef lppt As POINTAPI, cPoints As Long) As Long … … 824 1010 Declare Function SetBrushOrgEx Lib "gdi32" (hdc As HDC, nXOrg As Long, nYOrg As Long, ByRef lppt As POINTAPI) As Long 825 1011 Declare 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 1012 Declare Function SetEnhMetaFileBits Lib "gdi32" (cbBuffer As DWord, pData As *Byte) As HENHMETAFILE 826 1013 Declare Function SetMapMode Lib "gdi32" (hdc As HDC, fnMapMode As Long) As Long 1014 Declare Function SetMetaFileBitsEx Lib "gdi32" (nSize As DWord, pData As *Byte) As HMETAFILE 827 1015 Declare Function SetMiterLimit Lib "gdi32" (hdc As HDC, eNewLimit As Single, peOldLimit As SinglePtr) As Long 828 1016 Declare Function SetPixel Lib "gdi32" (hdc As HDC, x As Long, y As Long, crColor As DWord) As DWord … … 847 1035 Declare Function SetWindowExtEx Lib "gdi32" (hdc As HDC, nXExtent As Long, nYExtent As Long, ByRef lpSize As SIZE) As Long 848 1036 Declare Function SetWindowOrgEx Lib "gdi32" (hdc As HDC, x As Long, y As Long, ByRef lpPoint As POINTAPI) As Long 1037 Declare Function SetWinMetaFileBits Lib "gdi32" (cbBuffer As DWord, pbBuffer As *Byte, hdcRef As HDC, ByRef mfp As METAFILEPICT) As HENHMETAFILE 849 1038 Declare Function StartDoc Lib "gdi32" Alias "StartDocA" (hdc As HDC, ByRef ref_di As DOCINFO) As Long 850 1039 Declare Function StartPage Lib "gdi32" (hdc As HDC) As Long
Note:
See TracChangeset
for help on using the changeset viewer.