$TYPECHECK ON
$IFNDEF _GDIPLUS_INC
    $DEFINE _GDIPLUS_INC
'from VB translaton by Avery P. - 7/29/2002
' NOTES:
'   - All GDI+ Strings expect and return ONLY Unicode -
' WARNINGS:
'   - Some of the structs may not work, though I didn't test them all fully.
'   - If a function causes a GPF or performs unexpectedly, make sure you are passing correct arguments.
'     It also couldn't hurt to double-check the declarations as there is a chance they could be a bit off and looking in the MSDN can't hurt either.
'   - Some APIs that have a ByRef parameter may expect an array; check the MSDN to find out if unsure.


'-----------------------------------------------
' GDI+ Constants
'-----------------------------------------------
'Const LF_FACESIZE As Long = 32
'Const LF_FACESIZEW As Long = LF_FACESIZE * 2

'Const FlatnessDefault As Single = 1# / 4#

'Shift count and bit mask for A, R, G, B components
'Const AlphaShift = 24
'Const RedShift = 16
'Const GreenShift = 8
'Const BlueShift = 0

'Const AlphaMask = &HFF000000
'Const RedMask = &HFF0000
'Const GreenMask = &HFF00
'Const BlueMask = &HFF


' In-memory pixel data formats:
' bits 0-7 = format index
' bits 8-15 = pixel size (in bits)
' bits 16-23 = flags
' bits 24-31 = reserved
'Const PixelFormatIndexed = &H10000           ' Indexes into a palette
'Const PixelFormatGDI = &H20000               ' Is a GDI-supported format
'Const PixelFormatAlpha = &H40000             ' Has an alpha component
'Const PixelFormatPAlpha = &H80000            ' Pre-multiplied alpha
'Const PixelFormatExtended = &H100000         ' Extended color 16 bits/channel
'Const PixelFormatCanonical = &H200000

'Const PixelFormatUndefined = 0
'Const PixelFormatDontCare = 0

'Const PixelFormat1bppIndexed = &H30101
'Const PixelFormat4bppIndexed = &H30402
'Const PixelFormat8bppIndexed = &H30803
'Const PixelFormat16bppGreyScale = &H101004
'Const PixelFormat16bppRGB555 = &H21005
'Const PixelFormat16bppRGB565 = &H21006
'Const PixelFormat16bppARGB1555 = &H61007
'Const PixelFormat24bppRGB = &H21808
'Const PixelFormat32bppRGB = &H22009
'Const PixelFormat32bppARGB = &H26200A
'Const PixelFormat32bppPARGB = &HE200B
'Const PixelFormat48bppRGB = &H10300C
'Const PixelFormat64bppARGB = &H34400D
'Const PixelFormat64bppPARGB = &H1C400E
'Const PixelFormatMax = 15 '&HF



' Image property types
'Const PropertyTagTypeByte = 1
'Const PropertyTagTypeASCII = 2
'Const PropertyTagTypeShort = 3
'Const PropertyTagTypeLong = 4
'Const PropertyTagTypeRational = 5
'Const PropertyTagTypeUndefined = 7
'Const PropertyTagTypeSLONG = 9
'Const PropertyTagTypeSRational = 10


' Image property ID tags
'Const PropertyTagExifIFD = &H8769
'Const PropertyTagGpsIFD = &H8825

'Const PropertyTagNewSubfileType = &HFE
'Const PropertyTagSubfileType = &HFF
'Const PropertyTagImageWidth = &H100
'Const PropertyTagImageHeight = &H101
'Const PropertyTagBitsPerSample = &H102
'Const PropertyTagCompression = &H103
'Const PropertyTagPhotometricInterp = &H106
'Const PropertyTagThreshHolding = &H107
'Const PropertyTagCellWidth = &H108
'Const PropertyTagCellHeight = &H109
'Const PropertyTagFillOrder = &H10A
'Const PropertyTagDocumentName = &H10D
'Const PropertyTagImageDescription = &H10E
'Const PropertyTagEquipMake = &H10F
'Const PropertyTagEquipModel = &H110
'Const PropertyTagStripOffsets = &H111
'Const PropertyTagOrientation = &H112
'Const PropertyTagSamplesPerPixel = &H115
'Const PropertyTagRowsPerStrip = &H116
'Const PropertyTagStripBytesCount = &H117
'Const PropertyTagMinSampleValue = &H118
'Const PropertyTagMaxSampleValue = &H119
'Const PropertyTagXResolution = &H11A            ' Image resolution in width direction
'Const PropertyTagYResolution = &H11B            ' Image resolution in height direction
'Const PropertyTagPlanarConfig = &H11C           ' Image data arrangement
'Const PropertyTagPageName = &H11D
'Const PropertyTagXPosition = &H11E
'Const PropertyTagYPosition = &H11F
'Const PropertyTagFreeOffset = &H120
'Const PropertyTagFreeByteCounts = &H121
'Const PropertyTagGrayResponseUnit = &H122
'Const PropertyTagGrayResponseCurve = &H123
'Const PropertyTagT4Option = &H124
'Const PropertyTagT6Option = &H125
'Const PropertyTagResolutionUnit = &H128         ' Unit of X and Y resolution
'Const PropertyTagPageNumber = &H129
'Const PropertyTagTransferFuncition = &H12D
'Const PropertyTagSoftwareUsed = &H131
'Const PropertyTagDateTime = &H132
'Const PropertyTagArtist = &H13B
'Const PropertyTagHostComputer = &H13C
'Const PropertyTagPredictor = &H13D
'Const PropertyTagWhitePoint = &H13E
'Const PropertyTagPrimaryChromaticities = &H13F
'Const PropertyTagColorMap = &H140
'Const PropertyTagHalftoneHints = &H141
'Const PropertyTagTileWidth = &H142
'Const PropertyTagTileLength = &H143
'Const PropertyTagTileOffset = &H144
'Const PropertyTagTileByteCounts = &H145
'Const PropertyTagInkSet = &H14C
'Const PropertyTagInkNames = &H14D
'Const PropertyTagNumberOfInks = &H14E
'Const PropertyTagDotRange = &H150
'Const PropertyTagTargetPrinter = &H151
'Const PropertyTagExtraSamples = &H152
'Const PropertyTagSampleFormat = &H153
'Const PropertyTagSMinSampleValue = &H154
'Const PropertyTagSMaxSampleValue = &H155
'Const PropertyTagTransferRange = &H156

'Const PropertyTagJPEGProc = &H200
'Const PropertyTagJPEGInterFormat = &H201
'Const PropertyTagJPEGInterLength = &H202
'Const PropertyTagJPEGRestartInterval = &H203
'Const PropertyTagJPEGLosslessPredictors = &H205
'Const PropertyTagJPEGPointTransforms = &H206
'Const PropertyTagJPEGQTables = &H207
'Const PropertyTagJPEGDCTables = &H208
'Const PropertyTagJPEGACTables = &H209

'Const PropertyTagYCbCrCoefficients = &H211
'Const PropertyTagYCbCrSubsampling = &H212
'Const PropertyTagYCbCrPositioning = &H213
'Const PropertyTagREFBlackWhite = &H214

'Const PropertyTagICCProfile = &H8773            ' This TAG is defined by ICC
                                                ' for embedded ICC in TIFF
'Const PropertyTagGamma = &H301
'Const PropertyTagICCProfileDescriptor = &H302
'Const PropertyTagSRGBRenderingIntent = &H303

'Const PropertyTagImageTitle = &H320
'Const PropertyTagCopyright = &H8298

' Extra TAGs (Like Adobe Image Information tags etc.)

'Const PropertyTagResolutionXUnit = &H5001
'Const PropertyTagResolutionYUnit = &H5002
'Const PropertyTagResolutionXLengthUnit = &H5003
'Const PropertyTagResolutionYLengthUnit = &H5004
'Const PropertyTagPrintFlags = &H5005
'Const PropertyTagPrintFlagsVersion = &H5006
'Const PropertyTagPrintFlagsCrop = &H5007
'Const PropertyTagPrintFlagsBleedWidth = &H5008
'Const PropertyTagPrintFlagsBleedWidthScale = &H5009
'Const PropertyTagHalftoneLPI = &H500A
'Const PropertyTagHalftoneLPIUnit = &H500B
'Const PropertyTagHalftoneDegree = &H500C
'Const PropertyTagHalftoneShape = &H500D
'Const PropertyTagHalftoneMisc = &H500E
'Const PropertyTagHalftoneScreen = &H500F
'Const PropertyTagJPEGQuality = &H5010
'Const PropertyTagGridSize = &H5011
'Const PropertyTagThumbnailFormat = &H5012            ' 1 = JPEG, 0 = RAW RGB
'Const PropertyTagThumbnailWidth = &H5013
'Const PropertyTagThumbnailHeight = &H5014
'Const PropertyTagThumbnailColorDepth = &H5015
'Const PropertyTagThumbnailPlanes = &H5016
'Const PropertyTagThumbnailRawBytes = &H5017
'Const PropertyTagThumbnailSize = &H5018
'Const PropertyTagThumbnailCompressedSize = &H5019
'Const PropertyTagColorTransferFunction = &H501A
'Const PropertyTagThumbnailData = &H501B            ' RAW thumbnail bits in
                                                   ' JPEG format or RGB format
                                                   ' depends on
                                                   ' PropertyTagThumbnailFormat

' Thumbnail related TAGs
'Const PropertyTagThumbnailImageWidth = &H5020        ' Thumbnail width
'Const PropertyTagThumbnailImageHeight = &H5021       ' Thumbnail height
'Const PropertyTagThumbnailBitsPerSample = &H5022     ' Number of bits per
                                                     ' component
'Const PropertyTagThumbnailCompression = &H5023       ' Compression Scheme
'Const PropertyTagThumbnailPhotometricInterp = &H5024 ' Pixel composition
'Const PropertyTagThumbnailImageDescription = &H5025  ' Image Tile
'Const PropertyTagThumbnailEquipMake = &H5026         ' Manufacturer of Image
                                                     ' Input equipment
'Const PropertyTagThumbnailEquipModel = &H5027        ' Model of Image input
                                                     ' equipment
'Const PropertyTagThumbnailStripOffsets = &H5028      ' Image data location
'Const PropertyTagThumbnailOrientation = &H5029       ' Orientation of image
'Const PropertyTagThumbnailSamplesPerPixel = &H502A   ' Number of components
'Const PropertyTagThumbnailRowsPerStrip = &H502B      ' Number of rows per strip
'Const PropertyTagThumbnailStripBytesCount = &H502C   ' Bytes per compressed
                                                     ' strip
'Const PropertyTagThumbnailResolutionX = &H502D       ' Resolution in width
                                                     ' direction
'Const PropertyTagThumbnailResolutionY = &H502E       ' Resolution in height
                                                     ' direction
'Const PropertyTagThumbnailPlanarConfig = &H502F      ' Image data arrangement
'Const PropertyTagThumbnailResolutionUnit = &H5030    ' Unit of X and Y
                                                     ' Resolution
'Const PropertyTagThumbnailTransferFunction = &H5031  ' Transfer function
'Const PropertyTagThumbnailSoftwareUsed = &H5032      ' Software used
'Const PropertyTagThumbnailDateTime = &H5033          ' File change date and
                                                     ' time
'Const PropertyTagThumbnailArtist = &H5034            ' Person who created the
                                                     ' image
'Const PropertyTagThumbnailWhitePoint = &H5035        ' White point chromaticity
'Const PropertyTagThumbnailPrimaryChromaticities = &H5036
                                                     ' Chromaticities of
                                                     ' primaries
'Const PropertyTagThumbnailYCbCrCoefficients = &H5037 ' Color space transforma-
                                                     ' tion coefficients
'Const PropertyTagThumbnailYCbCrSubsampling = &H5038  ' Subsampling ratio of Y
                                                     ' to C
'Const PropertyTagThumbnailYCbCrPositioning = &H5039  ' Y and C position
'Const PropertyTagThumbnailRefBlackWhite = &H503A     ' Pair of black and white
                                                     ' reference values
'Const PropertyTagThumbnailCopyRight = &H503B         ' CopyRight holder

'Const PropertyTagLuminanceTable = &H5090
'Const PropertyTagChrominanceTable = &H5091

'Const PropertyTagFrameDelay = &H5100
'Const PropertyTagLoopCount = &H5101

'Const PropertyTagPixelUnit = &H5110          ' Unit specifier for pixel/unit
'Const PropertyTagPixelPerUnitX = &H5111      ' Pixels per unit in X
'Const PropertyTagPixelPerUnitY = &H5112      ' Pixels per unit in Y
'Const PropertyTagPaletteHistogram = &H5113   ' Palette histogram

' EXIF specific tag

'Const PropertyTagExifExposureTime = &H829A
'Const PropertyTagExifFNumber = &H829D

'Const PropertyTagExifExposureProg = &H8822
'Const PropertyTagExifSpectralSense = &H8824
'Const PropertyTagExifISOSpeed = &H8827
'Const PropertyTagExifOECF = &H8828

'Const PropertyTagExifVer = &H9000
'Const PropertyTagExifDTOrig = &H9003         ' Date & time of original
'Const PropertyTagExifDTDigitized = &H9004    ' Date & time of digital data generation

'Const PropertyTagExifCompConfig = &H9101
'Const PropertyTagExifCompBPP = &H9102

'Const PropertyTagExifShutterSpeed = &H9201
'Const PropertyTagExifAperture = &H9202
'Const PropertyTagExifBrightness = &H9203
'Const PropertyTagExifExposureBias = &H9204
'Const PropertyTagExifMaxAperture = &H9205
'Const PropertyTagExifSubjectDist = &H9206
'Const PropertyTagExifMeteringMode = &H9207
'Const PropertyTagExifLightSource = &H9208
'Const PropertyTagExifFlash = &H9209
'Const PropertyTagExifFocalLength = &H920A
'Const PropertyTagExifMakerNote = &H927C
'Const PropertyTagExifUserComment = &H9286
'Const PropertyTagExifDTSubsec = &H9290        ' Date & Time subseconds
'Const PropertyTagExifDTOrigSS = &H9291        ' Date & Time original subseconds
'Const PropertyTagExifDTDigSS = &H9292         ' Date & TIme digitized subseconds

'Const PropertyTagExifFPXVer = &HA000
'Const PropertyTagExifColorSpace = &HA001
'Const PropertyTagExifPixXDim = &HA002
'Const PropertyTagExifPixYDim = &HA003
'Const PropertyTagExifRelatedWav = &HA004      ' related sound file
'Const PropertyTagExifInterop = &HA005
'Const PropertyTagExifFlashEnergy = &HA20B
'Const PropertyTagExifSpatialFR = &HA20C       ' Spatial Frequency Response
'Const PropertyTagExifFocalXRes = &HA20E       ' Focal Plane X Resolution
'Const PropertyTagExifFocalYRes = &HA20F       ' Focal Plane Y Resolution
'Const PropertyTagExifFocalResUnit = &HA210    ' Focal Plane Resolution Unit
'Const PropertyTagExifSubjectLoc = &HA214
'Const PropertyTagExifExposureIndex = &HA215
'Const PropertyTagExifSensingMethod = &HA217
'Const PropertyTagExifFileSource = &HA300
'Const PropertyTagExifSceneType = &HA301
'Const PropertyTagExifCfaPattern = &HA302

'Const PropertyTagGpsVer = &H0
'Const PropertyTagGpsLatitudeRef = &H1
'Const PropertyTagGpsLatitude = &H2
'Const PropertyTagGpsLongitudeRef = &H3
'Const PropertyTagGpsLongitude = &H4
'Const PropertyTagGpsAltitudeRef = &H5
'Const PropertyTagGpsAltitude = &H6
'Const PropertyTagGpsGpsTime = &H7
'Const PropertyTagGpsGpsSatellites = &H8
'Const PropertyTagGpsGpsStatus = &H9
'Const PropertyTagGpsGpsMeasureMode = &HA
'Const PropertyTagGpsGpsDop = &HB              ' Measurement precision
'Const PropertyTagGpsSpeedRef = &HC
'Const PropertyTagGpsSpeed = &HD
'Const PropertyTagGpsTrackRef = &HE
'Const PropertyTagGpsTrack = &HF
'Const PropertyTagGpsImgDirRef = &H10
'Const PropertyTagGpsImgDir = &H11
'Const PropertyTagGpsMapDatum = &H12
'Const PropertyTagGpsDestLatRef = &H13
'Const PropertyTagGpsDestLat = &H14
'Const PropertyTagGpsDestLongRef = &H15
'Const PropertyTagGpsDestLong = &H16
'Const PropertyTagGpsDestBearRef = &H17
'Const PropertyTagGpsDestBear = &H18
'Const PropertyTagGpsDestDistRef = &H19
'Const PropertyTagGpsDestDist = &H1A


'//---------------------------------------------------------------------------
'// Image file format identifiers
'//---------------------------------------------------------------------------
'Const ImageFormatSuffix        As String = "-0728-11D3-9D7B-0000F81EF32E}"
'Const ImageFormatUndefined     As String = "{B96B3CA9" & ImageFormatSuffix
'Const ImageFormatMemoryBMP     As String = "{B96B3CAA" & ImageFormatSuffix
'Const ImageFormatBMP           As String = "{B96B3CAB" & ImageFormatSuffix
'Const ImageFormatEMF           As String = "{B96B3CAC" & ImageFormatSuffix
'Const ImageFormatWMF           As String = "{B96B3CAD" & ImageFormatSuffix
'Const ImageFormatJPEG          As String = "{B96B3CAE" & ImageFormatSuffix
'Const ImageFormatPNG           As String = "{B96B3CAF" & ImageFormatSuffix
'Const ImageFormatGIF           As String = "{B96B3CB0" & ImageFormatSuffix
'Const ImageFormatTIFF          As String = "{B96B3CB1" & ImageFormatSuffix
'Const ImageFormatEXIF          As String = "{B96B3CB2" & ImageFormatSuffix
'Const ImageFormatIcon          As String = "{B96B3CB5" & ImageFormatSuffix
'//---------------------------------------------------------------------------
'// Predefined multi-frame dimension IDs
'//---------------------------------------------------------------------------
'Const FrameDimensionTime       As String = "{6AEDBD6D-3FB5-418A-83A6-7F45229DC872}"
'Const FrameDimensionResolution As String = "{84236F7B-3BD3-428F-8DAB-4EA1439CA315}"
'Const FrameDimensionPage       As String = "{7462DC86-6180-4C7E-8E3F-EE7333A7A483}"
'//---------------------------------------------------------------------------
'// Property sets
'//---------------------------------------------------------------------------
'Const FormatIDImageInformation As String = "{E5836CBE-5EEF-0F1D-ACDE-AE4C43B608CE}"
'Const FormatIDJpegAppHeaders   As String = "{1C4AFDCD-6177-43CF-ABC7-5F51AF39EE85}"
'//---------------------------------------------------------------------------
'// Encoder parameter sets
'//---------------------------------------------------------------------------
'Const EncoderCompression       As String = "{E09D739D-CCD4-44EE-8EBA-3FBF8BE4FC58}"
'Const EncoderColorDepth        As String = "{66087055-AD66-4C7C-9A18-38A2310B8337}"
'Const EncoderScanMethod        As String = "{3A4E2661-3109-4E56-8536-42C156E7DCFA}"
'Const EncoderVersion           As String = "{24D18C76-814A-41A4-BF53-1C219CCCF797}"
'Const EncoderRenderMethod      As String = "{6D42C53A-229A-4825-8BB7-5C99E2B9A8B8}"
'Const EncoderQuality           As String = "{1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB}"
'Const EncoderTransformation    As String = "{8D0EB2D1-A58E-4EA8-AA14-108074B7B6F9}"
'Const EncoderLuminanceTable    As String = "{EDB33BCE-0266-4A77-B904-27216099E717}"
'Const EncoderChrominanceTable  As String = "{F2E455DC-09B3-4316-8260-676ADA32481C}"
'Const EncoderSaveFlag          As String = "{292266FC-AC40-47BF-8CFC-A85B89A655DE}"
'Const CodecIImageBytes         As String = "{025D1823-6C7D-447B-BBDB-A3CBC3DFA2FC}"

'-----------------------------------------------
' GDI+ Structs/Types
'-----------------------------------------------

Public Type GdiplusStartupInput
   GdiplusVersion As Long              ' Must be 1 for GDI+ v1.0, the current version as of this writing.
   DebugEventCallback As Long          ' Ignored on free builds
   SuppressBackgroundThread As Long    ' FALSE unless you're prepared to call
                                       ' the hook/unhook functions properly
   SuppressExternalCodecs As Long      ' FALSE unless you want GDI+ only to use
                                       ' its internal image codecs.
End Type

'
'
'Type ImageCodecInfo
'   ClassID As STRING * 16
'   FormatID As STRING * 16
'   CodecName As Long      ' String Pointer; const WCHAR*
'   DllName As Long        ' String Pointer; const WCHAR*
'   FormatDescription As Long ' String Pointer; const WCHAR*
'   FilenameExtension As Long ' String Pointer; const WCHAR*
'   MimeType As Long       ' String Pointer; const WCHAR*
'   flags As long            'ImageCodecFlags   ' Should be a Long equivalent
'   Version As Long
'   SigCount As Long
'   SigSize As Long
'   SigPattern As Long      ' Byte Array Pointer; BYTE*
'   SigMask As Long         ' Byte Array Pointer; BYTE*
'End Type
'
'' Encoder Parameter structure
'Type EncoderParameter
'   GUID As STRING * 16                          ' GUID of the parameter
'   NumberOfValues As Long                 ' Number of the parameter values; usually 1
'   type As long 'EncoderParameterValueType      ' Value type, like ValueTypeLONG  etc.
'   value As Long                          ' A pointer to the parameter values
'End Type
'
'' Encoder Parameters structure
'Type EncoderParameters
'   count As Long                          ' Number of parameters in this structure; Should be 1
'   Parameter As long EncoderParameter          ' Parameter values; this CAN be an array!!!! (Use CopyMemory and a string or byte array as workaround)
'End Type
'
'
'Type ColorPalette
'   flags As PaletteFlags      ' Palette flags; should be a Long equivalent
'   count As Long              ' Number of color entries used
'   Entries(0 To 255) As Long  ' Palette color entries. WARNING: SDK defines as 1 entry, but I made it
'                              ' contain 256 (a reasonable amount) for use with any palette count 256 or less
'                              ' since VB can't malloc and do type casting like C/C++.
'End Type
'
'Type ColorMap
'   oldColor As Long       ' Color oldColor;
'   newColor As Long       ' Color newColor;
'End Type
'
'Type ColorMatrix
'   m(0 To 4, 0 To 4) As Single
'End Type
'
'' Information about image pixel data
'Type BitmapData
'   Width As Long
'   Height As Long
'   stride As Long
'   PixelFormat As Long
'   scan0 As Long
'   Reserved As Long
'End Type

'Type PathData
'   count As Long
'   Points As Long    ' Pointer to POINTF array
'   types As Long     ' Pointer to BYTE array
'End Type
'
'Type PropertyItem
'   propId As Long              ' ID of this property
'   length As Long              ' Length of the property value, in bytes
'   type As Integer             ' Type of the value, as one of TAG_TYPE_XXX
'                               ' defined above
'   value As Long               ' property value
'End Type
'
'Type LOGFONTA
'   lfHeight As Long
'   lfWidth As Long
'   lfEscapement As Long
'   lfOrientation As Long
'   lfWeight As Long
'   lfItalic As Byte
'   lfUnderline As Byte
'   lfStrikeOut As Byte
'   lfCharSet As Byte
'   lfOutPrecision As Byte
'   lfClipPrecision As Byte
'   lfQuality As Byte
'   lfPitchAndFamily As Byte
'   lfFaceName As String * LF_FACESIZE
'End Type
'
'Type LOGFONTW
'   lfHeight As Long
'   lfWidth As Long
'   lfEscapement As Long
'   lfOrientation As Long
'   lfWeight As Long
'   lfItalic As Byte
'   lfUnderline As Byte
'   lfStrikeOut As Byte
'   lfCharSet As Byte
'   lfOutPrecision As Byte
'   lfClipPrecision As Byte
'   lfQuality As Byte
'   lfPitchAndFamily As Byte
'   lfFaceName As String * LF_FACESIZEW
'End Type
'
'Type CharacterRange
'   First As Long
'   length As Long
'End Type
'
'Type PWMFRect16
'   Left As Integer
'   Top As Integer
'   Right As Integer
'   Bottom As Integer
'End Type
'
'Type WmfPlaceableFileHeader
'   Key As Long                        ' GDIP_WMF_PLACEABLEKEY
'   Hmf As Integer                     ' Metafile HANDLE number (always 0)
'   boundingBox As PWMFRect16          ' Coordinates in metafile units
'   Inch As Integer                    ' Number of metafile units per inch
'   Reserved As Long                   ' Reserved (always 0)
'   Checksum As Integer                ' Checksum value for previous 10 WORDs
'End Type
'
'Type ENHMETAHEADER3
'   itype As Long               ' Record type EMR_HEADER
'   nSize As Long               ' Record size in bytes.  This may be greater
'                               ' than the sizeof(ENHMETAHEADER).
'   rclBounds As RECTL        ' Inclusive-inclusive bounds in device units
'   rclFrame As RECTL         ' Inclusive-inclusive Picture Frame .01mm unit
'   dSignature As Long          ' Signature.  Must be ENHMETA_SIGNATURE.
'   nVersion As Long            ' Version number
'   nBytes As Long              ' Size of the metafile in bytes
'   nRecords As Long            ' Number of records in the metafile
'   nHandles As Integer         ' Number of handles in the handle table
'                               ' Handle index zero is reserved.
'   sReserved As Integer        ' Reserved.  Must be zero.
'   nDescription As Long        ' Number of chars in the unicode desc string
'                               ' This is 0 if there is no description string
'   offDescription As Long      ' Offset to the metafile description record.
'                               ' This is 0 if there is no description string
'   nPalEntries As Long         ' Number of entries in the metafile palette.
'   szlDevice As SIZEL           ' Size of the reference device in pels
'   szlMillimeters As SIZEL      ' Size of the reference device in millimeters
'End Type
'
'Type METAHEADER
'   mtType As Integer
'   mtHeaderSize As Integer
'   mtVersion As Integer
'   mtSize As Long
'   mtNoObjects As Integer
'   mtMaxRecord As Long
'   mtNoParameters As Integer
'End Type
'
'Type MetafileHeader
'   mType As MetafileType
'   size As Long                ' Size of the metafile (in bytes)
'   Version As Long             ' EMF+, EMF, or WMF version
'   EmfPlusFlags As Long
'   DpiX As Single
'   DpiY As Single
'   x As Long                   ' Bounds in device units
'   y As Long
'   Width As Long
'   Height As Long
'   'Union
'   '{
'   '    METAHEADER WmfHeader
'   '    ENHMETAHEADER3 EmfHeader
'   '}
'   EmfHeader As ENHMETAHEADER3 ' NOTE: You'll have to use CopyMemory to view the METAHEADER type
'   EmfPlusHeaderSize As Long   ' size of the EMF+ header in file
'   LogicalDpiX As Long         ' Logical Dpi of reference Hdc
'   LogicalDpiY As Long         ' usually valid only for EMF+
'End Type
'
'

'-----------------------------------------------
' GDI+ Enums
'-----------------------------------------------
'
'Enum PaletteFlags
'   PaletteFlagsHasAlpha = &H1
'   PaletteFlagsGrayScale = &H2
'   PaletteFlagsHalftone = &H4
'End Enum
'
'Enum GpUnit  ' aka Unit
'   UnitWorld      ' 0 -- World coordinate (non-physical unit)
'   UnitDisplay    ' 1 -- Variable -- for PageTransform only
'   UnitPixel      ' 2 -- Each unit is one device pixel.
'   UnitPoint      ' 3 -- Each unit is a printer's point, or 1/72 inch.
'   UnitInch       ' 4 -- Each unit is 1 inch.
'   UnitDocument   ' 5 -- Each unit is 1/300 inch.
'   UnitMillimeter ' 6 -- Each unit is 1 millimeter.
'End Enum
'
'' Common color constants
'' NOTE: Oringinal enum was unnamed
'Enum Colors
'   AliceBlue = &HFFF0F8FF
'   AntiqueWhite = &HFFFAEBD7
'   Aqua = &HFF00FFFF
'   Aquamarine = &HFF7FFFD4
'   Azure = &HFFF0FFFF
'   Beige = &HFFF5F5DC
'   Bisque = &HFFFFE4C4
'   Black = &HFF000000
'   BlanchedAlmond = &HFFFFEBCD
'   Blue = &HFF0000FF
'   BlueViolet = &HFF8A2BE2
'   Brown = &HFFA52A2A
'   BurlyWood = &HFFDEB887
'   CadetBlue = &HFF5F9EA0
'   Chartreuse = &HFF7FFF00
'   Chocolate = &HFFD2691E
'   Coral = &HFFFF7F50
'   CornflowerBlue = &HFF6495ED
'   Cornsilk = &HFFFFF8DC
'   Crimson = &HFFDC143C
'   Cyan = &HFF00FFFF
'   DarkBlue = &HFF00008B
'   DarkCyan = &HFF008B8B
'   DarkGoldenrod = &HFFB8860B
'   DarkGray = &HFFA9A9A9
'   DarkGreen = &HFF006400
'   DarkKhaki = &HFFBDB76B
'   DarkMagenta = &HFF8B008B
'   DarkOliveGreen = &HFF556B2F
'   DarkOrange = &HFFFF8C00
'   DarkOrchid = &HFF9932CC
'   DarkRed = &HFF8B0000
'   DarkSalmon = &HFFE9967A
'   DarkSeaGreen = &HFF8FBC8B
'   DarkSlateBlue = &HFF483D8B
'   DarkSlateGray = &HFF2F4F4F
'   DarkTurquoise = &HFF00CED1
'   DarkViolet = &HFF9400D3
'   DeepPink = &HFFFF1493
'   DeepSkyBlue = &HFF00BFFF
'   DimGray = &HFF696969
'   DodgerBlue = &HFF1E90FF
'   Firebrick = &HFFB22222
'   FloralWhite = &HFFFFFAF0
'   ForestGreen = &HFF228B22
'   Fuchsia = &HFFFF00FF
'   Gainsboro = &HFFDCDCDC
'   GhostWhite = &HFFF8F8FF
'   Gold = &HFFFFD700
'   Goldenrod = &HFFDAA520
'   Gray = &HFF808080
'   Green = &HFF008000
'   GreenYellow = &HFFADFF2F
'   Honeydew = &HFFF0FFF0
'   HotPink = &HFFFF69B4
'   IndianRed = &HFFCD5C5C
'   Indigo = &HFF4B0082
'   Ivory = &HFFFFFFF0
'   Khaki = &HFFF0E68C
'   Lavender = &HFFE6E6FA
'   LavenderBlush = &HFFFFF0F5
'   LawnGreen = &HFF7CFC00
'   LemonChiffon = &HFFFFFACD
'   LightBlue = &HFFADD8E6
'   LightCoral = &HFFF08080
'   LightCyan = &HFFE0FFFF
'   LightGoldenrodYellow = &HFFFAFAD2
'   LightGray = &HFFD3D3D3
'   LightGreen = &HFF90EE90
'   LightPink = &HFFFFB6C1
'   LightSalmon = &HFFFFA07A
'   LightSeaGreen = &HFF20B2AA
'   LightSkyBlue = &HFF87CEFA
'   LightSlateGray = &HFF778899
'   LightSteelBlue = &HFFB0C4DE
'   LightYellow = &HFFFFFFE0
'   Lime = &HFF00FF00
'   LimeGreen = &HFF32CD32
'   Linen = &HFFFAF0E6
'   Magenta = &HFFFF00FF
'   Maroon = &HFF800000
'   MediumAquamarine = &HFF66CDAA
'   MediumBlue = &HFF0000CD
'   MediumOrchid = &HFFBA55D3
'   MediumPurple = &HFF9370DB
'   MediumSeaGreen = &HFF3CB371
'   MediumSlateBlue = &HFF7B68EE
'   MediumSpringGreen = &HFF00FA9A
'   MediumTurquoise = &HFF48D1CC
'   MediumVioletRed = &HFFC71585
'   MidnightBlue = &HFF191970
'   MintCream = &HFFF5FFFA
'   MistyRose = &HFFFFE4E1
'   Moccasin = &HFFFFE4B5
'   NavajoWhite = &HFFFFDEAD
'   Navy = &HFF000080
'   OldLace = &HFFFDF5E6
'   Olive = &HFF808000
'   OliveDrab = &HFF6B8E23
'   Orange = &HFFFFA500
'   OrangeRed = &HFFFF4500
'   Orchid = &HFFDA70D6
'   PaleGoldenrod = &HFFEEE8AA
'   PaleGreen = &HFF98FB98
'   PaleTurquoise = &HFFAFEEEE
'   PaleVioletRed = &HFFDB7093
'   PapayaWhip = &HFFFFEFD5
'   PeachPuff = &HFFFFDAB9
'   Peru = &HFFCD853F
'   Pink = &HFFFFC0CB
'   Plum = &HFFDDA0DD
'   PowderBlue = &HFFB0E0E6
'   Purple = &HFF800080
'   Red = &HFFFF0000
'   RosyBrown = &HFFBC8F8F
'   RoyalBlue = &HFF4169E1
'   SaddleBrown = &HFF8B4513
'   Salmon = &HFFFA8072
'   SandyBrown = &HFFF4A460
'   SeaGreen = &HFF2E8B57
'   SeaShell = &HFFFFF5EE
'   Sienna = &HFFA0522D
'   Silver = &HFFC0C0C0
'   SkyBlue = &HFF87CEEB
'   SlateBlue = &HFF6A5ACD
'   SlateGray = &HFF708090
'   Snow = &HFFFFFAFA
'   SpringGreen = &HFF00FF7F
'   SteelBlue = &HFF4682B4
'   Tan = &HFFD2B48C
'   Teal = &HFF008080
'   Thistle = &HFFD8BFD8
'   Tomato = &HFFFF6347
'   Transparent = &HFFFFFF
'   Turquoise = &HFF40E0D0
'   Violet = &HFFEE82EE
'   Wheat = &HFFF5DEB3
'   White = &HFFFFFFFF
'   WhiteSmoke = &HFFF5F5F5
'   Yellow = &HFFFFFF00
'   YellowGreen = &HFF9ACD32
'End Enum
'
'' NOTE: Enums evaluate to a Long
'Enum GpStatus   ' aka Status
'   Ok = 0
'   GenericError = 1
'   InvalidParameter = 2
'   OutOfMemory = 3
'   ObjectBusy = 4
'   InsufficientBuffer = 5
'   NotImplemented = 6
'   Win32Error = 7
'   WrongState = 8
'   Aborted = 9
'   FileNotFound = 10
'   ValueOverflow = 11
'   AccessDenied = 12
'   UnknownImageFormat = 13
'   FontFamilyNotFound = 14
'   FontStyleNotFound = 15
'   NotTrueTypeFont = 16
'   UnsupportedGdiplusVersion = 17
'   GdiplusNotInitialized = 18
'   PropertyNotFound = 19
'   PropertyNotSupported = 20
'End Enum
'
'' Quality mode constants
'Enum QualityMode
'   QualityModeInvalid = -1
'   QualityModeDefault = 0
'   QualityModeLow = 1       ' Best performance
'   QualityModeHigh = 2       ' Best rendering quality
'End Enum
'
'' Alpha Compositing mode constants
'Enum CompositingMode
'   CompositingModeSourceOver    ' 0
'   CompositingModeSourceCopy    ' 1
'End Enum
'
'' Alpha Compositing quality constants
'Enum CompositingQuality
'   CompositingQualityInvalid = QualityModeInvalid
'   CompositingQualityDefault = QualityModeDefault
'   CompositingQualityHighSpeed = QualityModeLow
'   CompositingQualityHighQuality = QualityModeHigh
'   CompositingQualityGammaCorrected
'   CompositingQualityAssumeLinear
'End Enum
'
'' Generic font families
'Enum GenericFontFamily
'   GenericFontFamilySerif
'   GenericFontFamilySansSerif
'   GenericFontFamilyMonospace
'End Enum
'
'' FontStyle: face types and common styles
'Enum FontStyle
'   FontStyleRegular = 0
'   FontStyleBold = 1
'   FontStyleItalic = 2
'   FontStyleBoldItalic = 3
'   FontStyleUnderline = 4
'   FontStyleStrikeout = 8
'End Enum
'
'Enum SmoothingMode
'   SmoothingModeInvalid = QualityModeInvalid
'   SmoothingModeDefault = QualityModeDefault
'   SmoothingModeHighSpeed = QualityModeLow
'   SmoothingModeHighQuality = QualityModeHigh
'   SmoothingModeNone
'   SmoothingModeAntiAlias
'End Enum
'
'Enum FillMode
'   FillModeAlternate        ' 0
'   FillModeWinding           ' 1
'End Enum
'
'Enum InterpolationMode
'   InterpolationModeInvalid = QualityModeInvalid
'   InterpolationModeDefault = QualityModeDefault
'   InterpolationModeLowQuality = QualityModeLow
'   InterpolationModeHighQuality = QualityModeHigh
'   InterpolationModeBilinear
'   InterpolationModeBicubic
'   InterpolationModeNearestNeighbor
'   InterpolationModeHighQualityBilinear
'   InterpolationModeHighQualityBicubic
'End Enum
'
'' Various wrap modes for brushes
'Enum WrapMode
'   WrapModeTile         ' 0
'   WrapModeTileFlipX    ' 1
'   WrapModeTileFlipY    ' 2
'   WrapModeTileFlipXY   ' 3
'   WrapModeClamp        ' 4
'End Enum
'
'Enum LinearGradientMode
'   LinearGradientModeHorizontal          ' 0
'   LinearGradientModeVertical            ' 1
'   LinearGradientModeForwardDiagonal     ' 2
'   LinearGradientModeBackwardDiagonal    ' 3
'End Enum
'
'Enum ImageType
'   ImageTypeUnknown    ' 0
'   ImageTypeBitmap     ' 1
'   ImageTypeMetafile   ' 2
'End Enum
'
'' Various Hatch Styles
'Enum HatchStyle
'   HatchStyleHorizontal                   ' 0
'   HatchStyleVertical                     ' 1
'   HatchStyleForwardDiagonal              ' 2
'   HatchStyleBackwardDiagonal             ' 3
'   HatchStyleCross                        ' 4
'   HatchStyleDiagonalCross                ' 5
'   HatchStyle05Percent                    ' 6
'   HatchStyle10Percent                    ' 7
'   HatchStyle20Percent                    ' 8
'   HatchStyle25Percent                    ' 9
'   HatchStyle30Percent                    ' 10
'   HatchStyle40Percent                    ' 11
'   HatchStyle50Percent                    ' 12
'   HatchStyle60Percent                    ' 13
'   HatchStyle70Percent                    ' 14
'   HatchStyle75Percent                    ' 15
'   HatchStyle80Percent                    ' 16
'   HatchStyle90Percent                    ' 17
'   HatchStyleLightDownwardDiagonal        ' 18
'   HatchStyleLightUpwardDiagonal          ' 19
'   HatchStyleDarkDownwardDiagonal         ' 20
'   HatchStyleDarkUpwardDiagonal           ' 21
'   HatchStyleWideDownwardDiagonal         ' 22
'   HatchStyleWideUpwardDiagonal           ' 23
'   HatchStyleLightVertical                ' 24
'   HatchStyleLightHorizontal              ' 25
'   HatchStyleNarrowVertical               ' 26
'   HatchStyleNarrowHorizontal             ' 27
'   HatchStyleDarkVertical                 ' 28
'   HatchStyleDarkHorizontal               ' 29
'   HatchStyleDashedDownwardDiagonal       ' 30
'   HatchStyleDashedUpwardDiagonal         ' 31
'   HatchStyleDashedHorizontal             ' 32
'   HatchStyleDashedVertical               ' 33
'   HatchStyleSmallConfetti                ' 34
'   HatchStyleLargeConfetti                ' 35
'   HatchStyleZigZag                       ' 36
'   HatchStyleWave                         ' 37
'   HatchStyleDiagonalBrick                ' 38
'   HatchStyleHorizontalBrick              ' 39
'   HatchStyleWeave                        ' 40
'   HatchStylePlaid                        ' 41
'   HatchStyleDivot                        ' 42
'   HatchStyleDottedGrid                   ' 43
'   HatchStyleDottedDiamond                ' 44
'   HatchStyleShingle                      ' 45
'   HatchStyleTrellis                      ' 46
'   HatchStyleSphere                       ' 47
'   HatchStyleSmallGrid                    ' 48
'   HatchStyleSmallCheckerBoard            ' 49
'   HatchStyleLargeCheckerBoard            ' 50
'   HatchStyleOutlinedDiamond              ' 51
'   HatchStyleSolidDiamond                 ' 52
'
'   HatchStyleTotal
'   HatchStyleLargeGrid = HatchStyleCross  ' 4
'
'   HatchStyleMin = HatchStyleHorizontal
'   HatchStyleMax = HatchStyleTotal - 1
'End Enum
'
'Enum MatrixOrder
'   MatrixOrderPrepend = 0
'   MatrixOrderAppend = 1
'End Enum
'
'Enum ColorAdjustType
'   ColorAdjustTypeDefault
'   ColorAdjustTypeBitmap
'   ColorAdjustTypeBrush
'   ColorAdjustTypePen
'   ColorAdjustTypeText
'   ColorAdjustTypeCount
'   ColorAdjustTypeAny      ' Reserved
'End Enum
'
'Enum ColorChannelFlags
'   ColorChannelFlagsC = 0
'   ColorChannelFlagsM
'   ColorChannelFlagsY
'   ColorChannelFlagsK
'   ColorChannelFlagsLast
'End Enum
'
'Enum ColorMatrixFlags
'   ColorMatrixFlagsDefault = 0
'   ColorMatrixFlagsSkipGrays = 1
'   ColorMatrixFlagsAltGray = 2
'End Enum
'
'Enum PenAlignment
'    PenAlignmentCenter = 0
'    PenAlignmentInset = 1
'End Enum
'
'Enum BrushType
'   BrushTypeSolidColor = 0
'   BrushTypeHatchFill = 1
'   BrushTypeTextureFill = 2
'   BrushTypePathGradient = 3
'   BrushTypeLinearGradient = 4
'End Enum
'
'Enum DashStyle
'   DashStyleSolid          ' 0
'   DashStyleDash           ' 1
'   DashStyleDot            ' 2
'   DashStyleDashDot        ' 3
'   DashStyleDashDotDot     ' 4
'   DashStyleCustom         ' 5
'End Enum
'
'' Dash cap constants
'Enum DashCap
'   DashCapFlat = 0
'   DashCapRound = 2
'   DashCapTriangle = 3
'End Enum
'
'' Line cap constants (only the lowest 8 bits are used).
'Enum LineCap
'   LineCapFlat = 0
'   LineCapSquare = 1
'   LineCapRound = 2
'   LineCapTriangle = 3
'
'   LineCapNoAnchor = &H10         ' corresponds to flat cap
'   LineCapSquareAnchor = &H11     ' corresponds to square cap
'   LineCapRoundAnchor = &H12      ' corresponds to round cap
'   LineCapDiamondAnchor = &H13    ' corresponds to triangle cap
'   LineCapArrowAnchor = &H14      ' no correspondence
'
'   LineCapCustom = &HFF           ' custom cap
'
'   LineCapAnchorMask = &HF0        ' mask to check for anchor or not.
'End Enum
'
'' Custom Line cap type constants
'Enum CustomLineCapType
'   CustomLineCapTypeDefault = 0
'   CustomLineCapTypeAdjustableArrow = 1
'End Enum
'
'' Line join constants
'Enum LineJoin
'   LineJoinMiter = 0
'   LineJoinBevel = 1
'   LineJoinRound = 2
'   LineJoinMiterClipped = 3
'End Enum
'
'' Pen's Fill types
'Enum PenType
'   PenTypeSolidColor = BrushTypeSolidColor
'   PenTypeHatchFill = BrushTypeHatchFill
'   PenTypeTextureFill = BrushTypeTextureFill
'   PenTypePathGradient = BrushTypePathGradient
'   PenTypeLinearGradient = BrushTypeLinearGradient
'   PenTypeUnknown = -1
'End Enum
'
'Enum WarpMode
'   WarpModePerspective     ' 0
'   WarpModeBilinear        ' 1
'End Enum
'
'' Region Comine Modes
'Enum CombineMode
'   CombineModeReplace      ' 0
'   CombineModeIntersect    ' 1
'   CombineModeUnion        ' 2
'   CombineModeXor          ' 3
'   CombineModeExclude      ' 4
'   CombineModeComplement   ' 5 (Exclude From)
'End Enum
'
'Enum RotateFlipType
'   RotateNoneFlipNone = 0
'   Rotate90FlipNone = 1
'   Rotate180FlipNone = 2
'   Rotate270FlipNone = 3
'
'   RotateNoneFlipX = 4
'   Rotate90FlipX = 5
'   Rotate180FlipX = 6
'   Rotate270FlipX = 7
'
'   RotateNoneFlipY = Rotate180FlipX
'   Rotate90FlipY = Rotate270FlipX
'   Rotate180FlipY = RotateNoneFlipX
'   Rotate270FlipY = Rotate90FlipX
'
'   RotateNoneFlipXY = Rotate180FlipNone
'   Rotate90FlipXY = Rotate270FlipNone
'   Rotate180FlipXY = RotateNoneFlipNone
'   Rotate270FlipXY = Rotate90FlipNone
'End Enum
'

' String format flags
'
'  DirectionRightToLeft          - For horizontal text, the reading order is
'                                  right to left. This value is called
'                                  the base embedding level by the Unicode
'                                  bidirectional engine.
'                                  For vertical text, columns are read from
'                                  right to left.
'                                  By default, horizontal or vertical text is
'                                  read from left to right.
'
'  DirectionVertical             - Individual lines of text are vertical. In
'                                  each line, characters progress from top to
'                                  bottom.
'                                  By default, lines of text are horizontal,
'                                  each new line below the previous line.
'
'  NoFitBlackBox                 - Allows parts of glyphs to overhang the
'                                  bounding rectangle.
'                                  By default glyphs are first aligned
'                                  inside the margines, then any glyphs which
'                                  still overhang the bounding box are
'                                  repositioned to avoid any overhang.
'                                  For example when an italic
'                                  lower case letter f in a font such as
'                                  Garamond is aligned at the far left of a
'                                  rectangle, the lower part of the f will
'                                  reach slightly further left than the left
'                                  edge of the rectangle. Setting this flag
'                                  will ensure the character aligns visually
'                                  with the lines above and below, but may
'                                  cause some pixels outside the formatting
'                                  rectangle to be clipped or painted.
'
'  DisplayFormatControl          - Causes control characters such as the
'                                  left-to-right mark to be shown in the
'                                  output with a representative glyph.
'
'  NoFontFallback                - Disables fallback to alternate fonts for
'                                  characters not supported in the requested
'                                  font. Any missing characters will be
'                                  be displayed with the fonts missing glyph,
'                                  usually an open square.
'
'  NoWrap                        - Disables wrapping of text between lines
'                                  when formatting within a rectangle.
'                                  NoWrap is implied when a point is passed
'                                  instead of a rectangle, or when the
'                                  specified rectangle has a zero line length.
'
'  NoClip                        - By default text is clipped to the
'                                  formatting rectangle. Setting NoClip
'                                  allows overhanging pixels to affect the
'                                  device outside the formatting rectangle.
'                                  Pixels at the end of the line may be
'                                  affected if the glyphs overhang their
'                                  cells, and either the NoFitBlackBox flag
'                                  has been set, or the glyph extends to far
'                                  to be fitted.
'                                  Pixels above/before the first line or
'                                  below/after the last line may be affected
'                                  if the glyphs extend beyond their cell
'                                  ascent / descent. This can occur rarely
'                                  with unusual diacritic mark combinations.
'Enum StringFormatFlags
'   StringFormatFlagsDirectionRightToLeft = &H1
'   StringFormatFlagsDirectionVertical = &H2
'   StringFormatFlagsNoFitBlackBox = &H4
'   StringFormatFlagsDisplayFormatControl = &H20
'   StringFormatFlagsNoFontFallback = &H400
'   StringFormatFlagsMeasureTrailingSpaces = &H800
'   StringFormatFlagsNoWrap = &H1000
'   StringFormatFlagsLineLimit = &H2000
'
'   StringFormatFlagsNoClip = &H4000
'End Enum
'
'Enum StringTrimming
'   StringTrimmingNone = 0
'   StringTrimmingCharacter = 1
'   StringTrimmingWord = 2
'   StringTrimmingEllipsisCharacter = 3
'   StringTrimmingEllipsisWord = 4
'   StringTrimmingEllipsisPath = 5
'End Enum
'
'' National language digit substitution
'Enum StringDigitSubstitute
'   StringDigitSubstituteUser = 0         ' As NLS setting
'   StringDigitSubstituteNone = 1
'   StringDigitSubstituteNational = 2
'   StringDigitSubstituteTraditional = 3
'End Enum
'
'' Hotkey prefix interpretation
'Enum HotkeyPrefix
'   HotkeyPrefixNone = 0
'   HotkeyPrefixShow = 1
'   HotkeyPrefixHide = 2
'End Enum
'
'Enum StringAlignment
'   ' Left edge for left-to-right text,
'   ' right for right-to-left text,
'   ' and top for vertical
'   StringAlignmentNear = 0
'   StringAlignmentCenter = 1
'   StringAlignmentFar = 2
'End Enum
'
'Enum FlushIntention
'   FlushIntentionFlush = 0         ' Flush all batched rendering operations
'   FlushIntentionSync = 1          ' Flush all batched rendering operations
'                                   ' and wait for them to complete
'End Enum
'
'' Image encoder parameter related types
'Enum EncoderParameterValueType
'   EncoderParameterValueTypeByte = 1              ' 8-bit unsigned int
'   EncoderParameterValueTypeASCII = 2             ' 8-bit byte containing one 7-bit ASCII
'                                                   ' code. NULL terminated.
'   EncoderParameterValueTypeShort = 3             ' 16-bit unsigned int
'   EncoderParameterValueTypeLong = 4              ' 32-bit unsigned int
'   EncoderParameterValueTypeRational = 5          ' Two Longs. The first Long is the
'                                                   ' numerator the second Long expresses the
'                                                   ' denomintor.
'   EncoderParameterValueTypeLongRange = 6         ' Two longs which specify a range of
'                                                   ' integer values. The first Long specifies
'                                                   ' the lower end and the second one
'                                                   ' specifies the higher end. All values
'                                                   ' are inclusive at both ends
'   EncoderParameterValueTypeUndefined = 7         ' 8-bit byte that can take any value
'                                                   ' depending on field definition
'   EncoderParameterValueTypeRationalRange = 8      ' Two Rationals. The first Rational
'                                                   ' specifies the lower end and the second
'                                                   ' specifies the higher end. All values
'                                                   ' are inclusive at both ends
'End Enum
'
'' Image encoder value types
'Enum EncoderValue
'   EncoderValueColorTypeCMYK
'   EncoderValueColorTypeYCCK
'   EncoderValueCompressionLZW
'   EncoderValueCompressionCCITT3
'   EncoderValueCompressionCCITT4
'   EncoderValueCompressionRle
'   EncoderValueCompressionNone
'   EncoderValueScanMethodInterlaced
'   EncoderValueScanMethodNonInterlaced
'   EncoderValueVersionGif87
'   EncoderValueVersionGif89
'   EncoderValueRenderProgressive
'   EncoderValueRenderNonProgressive
'   EncoderValueTransformRotate90
'   EncoderValueTransformRotate180
'   EncoderValueTransformRotate270
'   EncoderValueTransformFlipHorizontal
'   EncoderValueTransformFlipVertical
'   EncoderValueMultiFrame
'   EncoderValueLastFrame
'   EncoderValueFlush
'   EncoderValueFrameDimensionTime
'   EncoderValueFrameDimensionResolution
'   EncoderValueFrameDimensionPage
'End Enum
'
'Enum PixelOffsetMode
'   PixelOffsetModeInvalid = QualityModeInvalid
'   PixelOffsetModeDefault = QualityModeDefault
'   PixelOffsetModeHighSpeed = QualityModeLow
'   PixelOffsetModeHighQuality = QualityModeHigh
'   PixelOffsetModeNone    ' No pixel offset
'   PixelOffsetModeHalf     ' Offset by -0.5 -0.5 for fast anti-alias perf
'End Enum
'
'Enum TextRenderingHint
'   TextRenderingHintSystemDefault = 0            ' Glyph with system default rendering hint
'   TextRenderingHintSingleBitPerPixelGridFit     ' Glyph bitmap with hinting
'   TextRenderingHintSingleBitPerPixel            ' Glyph bitmap without hinting
'   TextRenderingHintAntiAliasGridFit             ' Glyph anti-alias bitmap with hinting
'   TextRenderingHintAntiAlias                    ' Glyph anti-alias bitmap without hinting
'   TextRenderingHintClearTypeGridFit              ' Glyph CT bitmap with hinting
'End Enum
'
'Enum MetafileType
'   MetafileTypeInvalid            ' Invalid metafile
'   MetafileTypeWmf                ' Standard WMF
'   MetafileTypeWmfPlaceable       ' Placeable WMF
'   MetafileTypeEmf                ' EMF (not EMF+)
'   MetafileTypeEmfPlusOnly        ' EMF+ without dual down-level records
'   MetafileTypeEmfPlusDual         ' EMF+ with dual down-level records
'End Enum
'
'' Specifies the type of EMF to record
'Enum EmfType
'    EmfTypeEmfOnly = MetafileTypeEmf               ' no EMF+  only EMF
'    EmfTypeEmfPlusOnly = MetafileTypeEmfPlusOnly   ' no EMF  only EMF+
'    EmfTypeEmfPlusDual = MetafileTypeEmfPlusDual   ' both EMF+ and EMF
'End Enum
'
'' EMF+ Persistent object types
'Enum ObjectType
'    ObjectTypeInvalid
'    ObjectTypeBrush
'    ObjectTypePen
'    ObjectTypePath
'    ObjectTypeRegion
'    ObjectTypeImage
'    ObjectTypeFont
'    ObjectTypeStringFormat
'    ObjectTypeImageAttributes
'    ObjectTypeCustomLineCap
'
'    ObjectTypeMax = ObjectTypeCustomLineCap
'    ObjectTypeMin = ObjectTypeBrush
'End Enum
'
'' The frameRect for creating a metafile can be specified in any of these
'' units.  There is an extra frame unit value (MetafileFrameUnitGdi) so
'' that units can be supplied in the same units that GDI expects for
'' frame rects -- these units are in .01 (1/100ths) millimeter units
'' as defined by GDI.
'Enum MetafileFrameUnit
'   MetafileFrameUnitPixel = UnitPixel
'   MetafileFrameUnitPoint = UnitPoint
'   MetafileFrameUnitInch = UnitInch
'   MetafileFrameUnitDocument = UnitDocument
'   MetafileFrameUnitMillimeter = UnitMillimeter
'   MetafileFrameUnitGdi                        ' GDI compatible .01 MM units
'End Enum
'
'' Coordinate space identifiers
'Enum CoordinateSpace
'   CoordinateSpaceWorld     ' 0
'   CoordinateSpacePage      ' 1
'   CoordinateSpaceDevice     ' 2
'End Enum
'
'' Added 12/4/2002
'' This enum was translated by: Dana Seaman
'Enum EmfPlusRecordType
'   '//Since we have to enumerate GDI records right along with GDI+ records
'   '//We list all the GDI records here so that they can be part of the
'   '//same enumeration type which is used in the enumeration callback.
'   WmfRecordTypeSetBkColor = &H10201
'   WmfRecordTypeSetBkMode = &H10102
'   WmfRecordTypeSetMapMode = &H10103
'   WmfRecordTypeSetROP2 = &H10104
'   WmfRecordTypeSetRelAbs = &H10105
'   WmfRecordTypeSetPolyFillMode = &H10106
'   WmfRecordTypeSetStretchBltMode = &H10107
'   WmfRecordTypeSetTextCharExtra = &H10108
'   WmfRecordTypeSetTextColor = &H10209
'   WmfRecordTypeSetTextJustification = &H1020A
'   WmfRecordTypeSetWindowOrg = &H1020B
'   WmfRecordTypeSetWindowExt = &H1020C
'   WmfRecordTypeSetViewportOrg = &H1020D
'   WmfRecordTypeSetViewportExt = &H1020E
'   WmfRecordTypeOffsetWindowOrg = &H1020F
'   WmfRecordTypeScaleWindowExt = &H10410
'   WmfRecordTypeOffsetViewportOrg = &H10211
'   WmfRecordTypeScaleViewportExt = &H10412
'   WmfRecordTypeLineTo = &H10213
'   WmfRecordTypeMoveTo = &H10214
'   WmfRecordTypeExcludeClipRect = &H10415
'   WmfRecordTypeIntersectClipRect = &H10416
'   WmfRecordTypeArc = &H10817
'   WmfRecordTypeEllipse = &H10418
'   WmfRecordTypeFloodFill = &H10419
'   WmfRecordTypePie = &H1081A
'   WmfRecordTypeRectangle = &H1041B
'   WmfRecordTypeRoundRect = &H1061C
'   WmfRecordTypePatBlt = &H1061D
'   WmfRecordTypeSaveDC = &H1001E
'   WmfRecordTypeSetPixel = &H1041F
'   WmfRecordTypeOffsetClipRgn = &H10220
'   WmfRecordTypeTextOut = &H10521
'   WmfRecordTypeBitBlt = &H10922
'   WmfRecordTypeStretchBlt = &H10B23
'   WmfRecordTypePolygon = &H10324
'   WmfRecordTypePolyline = &H10325
'   WmfRecordTypeEscape = &H10626
'   WmfRecordTypeRestoreDC = &H10127
'   WmfRecordTypeFillRegion = &H10228
'   WmfRecordTypeFrameRegion = &H10429
'   WmfRecordTypeInvertRegion = &H1012A
'   WmfRecordTypePaintRegion = &H1012B
'   WmfRecordTypeSelectClipRegion = &H1012C
'   WmfRecordTypeSelectObject = &H1012D
'   WmfRecordTypeSetTextAlign = &H1012E
'   WmfRecordTypeDrawText = &H1062F
'   WmfRecordTypeChord = &H10830
'   WmfRecordTypeSetMapperFlags = &H10231
'   WmfRecordTypeExtTextOut = &H10A32
'   WmfRecordTypeSetDIBToDev = &H10D33
'   WmfRecordTypeSelectPalette = &H10234
'   WmfRecordTypeRealizePalette = &H10035
'   WmfRecordTypeAnimatePalette = &H10436
'   WmfRecordTypeSetPalEntries = &H10037
'   WmfRecordTypePolyPolygon = &H10538
'   WmfRecordTypeResizePalette = &H10139
'   WmfRecordTypeDIBBitBlt = &H10940
'   WmfRecordTypeDIBStretchBlt = &H10B41
'   WmfRecordTypeDIBCreatePatternBrush = &H10142
'   WmfRecordTypeStretchDIB = &H10F43
'   WmfRecordTypeExtFloodFill = &H10548
'   WmfRecordTypeSetLayout = &H10149
'   WmfRecordTypeResetDC = &H1014C
'   WmfRecordTypeStartDoc = &H1014D
'   WmfRecordTypeStartPage = &H1004F
'   WmfRecordTypeEndPage = &H10050
'   WmfRecordTypeAbortDoc = &H10052
'   WmfRecordTypeEndDoc = &H1005E
'   WmfRecordTypeDeleteObject = &H101F0
'   WmfRecordTypeCreatePalette = &H100F7
'   WmfRecordTypeCreateBrush = &H100F8
'   WmfRecordTypeCreatePatternBrush = &H101F9
'   WmfRecordTypeCreatePenIndirect = &H102FA
'   WmfRecordTypeCreateFontIndirect = &H102FB
'   WmfRecordTypeCreateBrushIndirect = &H102FC
'   WmfRecordTypeCreateBitmapIndirect = &H102FD
'   WmfRecordTypeCreateBitmap = &H106FE
'   WmfRecordTypeCreateRegion = &H106FF
'   EmfRecordTypeHeader = 1
'   EmfRecordTypePolyBezier = 2
'   EmfRecordTypePolygon = 3
'   EmfRecordTypePolyline = 4
'   EmfRecordTypePolyBezierTo = 5
'   EmfRecordTypePolyLineTo = 6
'   EmfRecordTypePolyPolyline = 7
'   EmfRecordTypePolyPolygon = 8
'   EmfRecordTypeSetWindowExtEx = 9
'   EmfRecordTypeSetWindowOrgEx = 10
'   EmfRecordTypeSetViewportExtEx = 11
'   EmfRecordTypeSetViewportOrgEx = 12
'   EmfRecordTypeSetBrushOrgEx = 13
'   EmfRecordTypeEOF = 14
'   EmfRecordTypeSetPixelV = 15
'   EmfRecordTypeSetMapperFlags = 16
'   EmfRecordTypeSetMapMode = 17
'   EmfRecordTypeSetBkMode = 18
'   EmfRecordTypeSetPolyFillMode = 19
'   EmfRecordTypeSetROP2 = 20
'   EmfRecordTypeSetStretchBltMode = 21
'   EmfRecordTypeSetTextAlign = 22
'   EmfRecordTypeSetColorAdjustment = 23
'   EmfRecordTypeSetTextColor = 24
'   EmfRecordTypeSetBkColor = 25
'   EmfRecordTypeOffsetClipRgn = 26
'   EmfRecordTypeMoveToEx = 27
'   EmfRecordTypeSetMetaRgn = 28
'   EmfRecordTypeExcludeClipRect = 29
'   EmfRecordTypeIntersectClipRect = 30
'   EmfRecordTypeScaleViewportExtEx = 31
'   EmfRecordTypeScaleWindowExtEx = 32
'   EmfRecordTypeSaveDC = 33
'   EmfRecordTypeRestoreDC = 34
'   EmfRecordTypeSetWorldTransform = 35
'   EmfRecordTypeModifyWorldTransform = 36
'   EmfRecordTypeSelectObject = 37
'   EmfRecordTypeCreatePen = 38
'   EmfRecordTypeCreateBrushIndirect = 39
'   EmfRecordTypeDeleteObject = 40
'   EmfRecordTypeAngleArc = 41
'   EmfRecordTypeEllipse = 42
'   EmfRecordTypeRectangle = 43
'   EmfRecordTypeRoundRect = 44
'   EmfRecordTypeArc = 45
'   EmfRecordTypeChord = 46
'   EmfRecordTypePie = 47
'   EmfRecordTypeSelectPalette = 48
'   EmfRecordTypeCreatePalette = 49
'   EmfRecordTypeSetPaletteEntries = 50
'   EmfRecordTypeResizePalette = 51
'   EmfRecordTypeRealizePalette = 52
'   EmfRecordTypeExtFloodFill = 53
'   EmfRecordTypeLineTo = 54
'   EmfRecordTypeArcTo = 55
'   EmfRecordTypePolyDraw = 56
'   EmfRecordTypeSetArcDirection = 57
'   EmfRecordTypeSetMiterLimit = 58
'   EmfRecordTypeBeginPath = 59
'   EmfRecordTypeEndPath = 60
'   EmfRecordTypeCloseFigure = 61
'   EmfRecordTypeFillPath = 62
'   EmfRecordTypeStrokeAndFillPath = 63
'   EmfRecordTypeStrokePath = 64
'   EmfRecordTypeFlattenPath = 65
'   EmfRecordTypeWidenPath = 66
'   EmfRecordTypeSelectClipPath = 67
'   EmfRecordTypeAbortPath = 68
'   EmfRecordTypeReserved_069 = 69
'   EmfRecordTypeGdiComment = 70
'   EmfRecordTypeFillRgn = 71
'   EmfRecordTypeFrameRgn = 72
'   EmfRecordTypeInvertRgn = 73
'   EmfRecordTypePaintRgn = 74
'   EmfRecordTypeExtSelectClipRgn = 75
'   EmfRecordTypeBitBlt = 76
'   EmfRecordTypeStretchBlt = 77
'   EmfRecordTypeMaskBlt = 78
'   EmfRecordTypePlgBlt = 79
'   EmfRecordTypeSetDIBitsToDevice = 80
'   EmfRecordTypeStretchDIBits = 81
'   EmfRecordTypeExtCreateFontIndirect = 82
'   EmfRecordTypeExtTextOutA = 83
'   EmfRecordTypeExtTextOutW = 84
'   EmfRecordTypePolyBezier16 = 85
'   EmfRecordTypePolygon16 = 86
'   EmfRecordTypePolyline16 = 87
'   EmfRecordTypePolyBezierTo16 = 88
'   EmfRecordTypePolylineTo16 = 89
'   EmfRecordTypePolyPolyline16 = 90
'   EmfRecordTypePolyPolygon16 = 91
'   EmfRecordTypePolyDraw16 = 92
'   EmfRecordTypeCreateMonoBrush = 93
'   EmfRecordTypeCreateDIBPatternBrushPt = 94
'   EmfRecordTypeExtCreatePen = 95
'   EmfRecordTypePolyTextOutA = 96
'   EmfRecordTypePolyTextOutW = 97
'   EmfRecordTypeSetICMMode = 98
'   EmfRecordTypeCreateColorSpace = 99
'   EmfRecordTypeSetColorSpace = 100
'   EmfRecordTypeDeleteColorSpace = 101
'   EmfRecordTypeGLSRecord = 102
'   EmfRecordTypeGLSBoundedRecord = 103
'   EmfRecordTypePixelFormat = 104
'   EmfRecordTypeDrawEscape = 105
'   EmfRecordTypeExtEscape = 106
'   EmfRecordTypeStartDoc = 107
'   EmfRecordTypeSmallTextOut = 108
'   EmfRecordTypeForceUFIMapping = 109
'   EmfRecordTypeNamedEscape = 110
'   EmfRecordTypeColorCorrectPalette = 111
'   EmfRecordTypeSetICMProfileA = 112
'   EmfRecordTypeSetICMProfileW = 113
'   EmfRecordTypeAlphaBlend = 114
'   EmfRecordTypeSetLayout = 115
'   EmfRecordTypeTransparentBlt = 116
'   EmfRecordTypeReserved_117 = 117
'   EmfRecordTypeGradientFill = 118
'   EmfRecordTypeSetLinkedUFIs = 119
'   EmfRecordTypeSetTextJustification = 120
'   EmfRecordTypeColorMatchToTargetW = 121
'   EmfRecordTypeCreateColorSpaceW = 122
'   EmfRecordTypeMax = 122
'   EmfRecordTypeMin = 1
'   '//That is the END of the GDI EMF records.
'   '//Now we start the list of EMF+ records.  We leave quite
'   '//a bit of room here for the addition of any new GDI
'   '//records that may be added later.
'   EmfPlusRecordTypeInvalid = 16384 '//GDIP_EMFPLUS_RECORD_BASE
'   EmfPlusRecordTypeHeader = 16385
'   EmfPlusRecordTypeEndOfFile = 16386
'   EmfPlusRecordTypeComment = 16387
'   EmfPlusRecordTypeGetDC = 16388
'   EmfPlusRecordTypeMultiFormatStart = 16389
'   EmfPlusRecordTypeMultiFormatSection = 16390
'   EmfPlusRecordTypeMultiFormatEnd = 16391
'   '//For all persistent objects
'   EmfPlusRecordTypeObject = 16392
'   '//Drawing Records
'   EmfPlusRecordTypeClear = 16393
'   EmfPlusRecordTypeFillRects = 16394
'   EmfPlusRecordTypeDrawRects = 16395
'   EmfPlusRecordTypeFillPolygon = 16396
'   EmfPlusRecordTypeDrawLines = 16397
'   EmfPlusRecordTypeFillEllipse = 16398
'   EmfPlusRecordTypeDrawEllipse = 16399
'   EmfPlusRecordTypeFillPie = 16400
'   EmfPlusRecordTypeDrawPie = 16401
'   EmfPlusRecordTypeDrawArc = 16402
'   EmfPlusRecordTypeFillRegion = 16403
'   EmfPlusRecordTypeFillPath = 16404
'   EmfPlusRecordTypeDrawPath = 16405
'   EmfPlusRecordTypeFillClosedCurve = 16406
'   EmfPlusRecordTypeDrawClosedCurve = 16407
'   EmfPlusRecordTypeDrawCurve = 16408
'   EmfPlusRecordTypeDrawBeziers = 16409
'   EmfPlusRecordTypeDrawImage = 16410
'   EmfPlusRecordTypeDrawImagePoints = 16411
'   EmfPlusRecordTypeDrawString = 16412
'   '//Graphics State Records
'   EmfPlusRecordTypeSetRenderingOrigin = 16413
'   EmfPlusRecordTypeSetAntiAliasMode = 16414
'   EmfPlusRecordTypeSetTextRenderingHint = 16415
'   EmfPlusRecordTypeSetTextContrast = 16416
'   EmfPlusRecordTypeSetInterpolationMode = 16417
'   EmfPlusRecordTypeSetPixelOffsetMode = 16418
'   EmfPlusRecordTypeSetCompositingMode = 16419
'   EmfPlusRecordTypeSetCompositingQuality = 16420
'   EmfPlusRecordTypeSave = 16421
'   EmfPlusRecordTypeRestore = 16422
'   EmfPlusRecordTypeBeginContainer = 16423
'   EmfPlusRecordTypeBeginContainerNoParams = 16424
'   EmfPlusRecordTypeEndContainer = 16425
'   EmfPlusRecordTypeSetWorldTransform = 16426
'   EmfPlusRecordTypeResetWorldTransform = 16427
'   EmfPlusRecordTypeMultiplyWorldTransform = 16428
'   EmfPlusRecordTypeTranslateWorldTransform = 16429
'   EmfPlusRecordTypeScaleWorldTransform = 16430
'   EmfPlusRecordTypeRotateWorldTransform = 16431
'   EmfPlusRecordTypeSetPageTransform = 16432
'   EmfPlusRecordTypeResetClip = 16433
'   EmfPlusRecordTypeSetClipRect = 16434
'   EmfPlusRecordTypeSetClipPath = 16435
'   EmfPlusRecordTypeSetClipRegion = 16436
'   EmfPlusRecordTypeOffsetClip = 16437
'   EmfPlusRecordTypeDrawDriverString = 16438
'   EmfPlusRecordTotal = 16439
'   EmfPlusRecordTypeMax = 16438
'   EmfPlusRecordTypeMin = 16385
'End Enum
'
'' Information flags about image codecs
'Enum ImageCodecFlags
'   ImageCodecFlagsEncoder = &H1
'   ImageCodecFlagsDecoder = &H2
'   ImageCodecFlagsSupportBitmap = &H4
'   ImageCodecFlagsSupportVector = &H8
'   ImageCodecFlagsSeekableEncode = &H10
'   ImageCodecFlagsBlockingDecode = &H20
'
'   ImageCodecFlagsBuiltin = &H10000
'   ImageCodecFlagsSystem = &H20000
'   ImageCodecFlagsUser = &H40000
'End Enum
'
'' Access modes used when calling Image::LockBits (GdipBitmapLockBits API)
'Enum ImageLockMode
'   ImageLockModeRead = &H1
'   ImageLockModeWrite = &H2
'   ImageLockModeUserInputBuf = &H4
'End Enum
'
'Enum DebugEventLevel
'    DebugEventLevelFatal
'    DebugEventLevelWarning
'End Enum
'
'
'

'-----------------------------------------------
' APIs
'-----------------------------------------------

DECLARE FUNCTION GdiplusStartup LIB "GdiPlus.dll" ALIAS "GdiplusStartup"(ByRef token AS LONG , byref lpInput AS GdiplusStartupInput , pOutput AS LONG) AS LONG
DECLARE FUNCTION GdiplusShutdown LIB "GDIPlus.dll" ALIAS "GdiplusShutdown"(ByVal token AS LONG) AS LONG


' Graphics Functions (ALL)                               
declare function GdipFlush Lib "gdiplus" ALIAS "GdipFlush" (ByVal graphics As Long, ByVal intention As long) AS LONG                  
declare function GdipCreateFromHDC Lib "gdiplus" ALIAS "GdipCreateFromHDC" (ByVal hdc As Long, graphics As Long) AS LONG                   
declare function GdipCreateFromHWND Lib "gdiplus" ALIAS "GdipCreateFromHWND" (ByVal hwnd As Long, graphics As Long) AS LONG                   
declare function GdipCreateFromHWNDICM Lib "gdiplus" ALIAS "GdipCreateFromHWNDICM" (ByVal hwnd As Long, graphics As Long) AS LONG                   
declare function GdipDeleteGraphics Lib "gdiplus" ALIAS "GdipDeleteGraphics" (ByVal graphics As Long) AS LONG                      
declare function GdipGetDC Lib "gdiplus" ALIAS "GdipGetDC" (ByVal graphics As Long, hdc As Long) AS LONG                   
declare function GdipReleaseDC Lib "gdiplus" ALIAS "GdipReleaseDC" (ByVal graphics As Long, ByVal hdc As Long) AS LONG                  
declare function GdipSetCompositingMode Lib "gdiplus" ALIAS "GdipSetCompositingMode" (ByVal graphics As Long, ByVal CompositingMd As long) AS LONG                  
declare function GdipGetCompositingMode Lib "gdiplus" ALIAS "GdipGetCompositingMode" (ByVal graphics As Long, CompositingMd As long) AS LONG                   
declare function GdipSetRenderingOrigin Lib "gdiplus" ALIAS "GdipSetRenderingOrigin" (ByVal graphics As Long, ByVal x As Long, ByVal y As Long) AS LONG              
declare function GdipGetRenderingOrigin Lib "gdiplus" ALIAS "GdipGetRenderingOrigin" (ByVal graphics As Long, x As Long, y As Long) AS LONG                
declare function GdipSetCompositingQuality Lib "gdiplus" ALIAS "GdipSetCompositingQuality" (ByVal graphics As Long, ByVal CompositingQlty As long) AS LONG 
declare function GdipGetCompositingQuality Lib "gdiplus" ALIAS "GdipGetCompositingQuality" (ByVal graphics As Long, CompositingQlty As long) AS LONG 
declare function GdipSetSmoothingMode Lib "gdiplus" ALIAS "GdipSetSmoothingMode" (ByVal graphics As Long, ByVal SmoothingMd As long) AS LONG 
declare function GdipGetSmoothingMode Lib "gdiplus" ALIAS "GdipGetSmoothingMode" (ByVal graphics As Long, SmoothingMd As long) AS LONG 
declare function GdipSetPixelOffsetMode Lib "gdiplus" ALIAS "GdipSetPixelOffsetMode" (ByVal graphics As Long, ByVal PixOffsetMode As long) AS LONG 
declare function GdipGetPixelOffsetMode Lib "gdiplus" ALIAS "GdipGetPixelOffsetMode" (ByVal graphics As Long, PixOffsetMode As long) AS LONG 
declare function GdipSetTextRenderingHint Lib "gdiplus" ALIAS "GdipSetTextRenderingHint" (ByVal graphics As Long, ByVal mode As long) AS LONG 
declare function GdipGetTextRenderingHint Lib "gdiplus" ALIAS "GdipGetTextRenderingHint" (ByVal graphics As Long, mode As long) AS LONG 
declare function GdipSetTextContrast Lib "gdiplus" ALIAS "GdipSetTextContrast" (ByVal graphics As Long, ByVal contrast As Long) AS LONG 
declare function GdipGetTextContrast Lib "gdiplus" ALIAS "GdipGetTextContrast" (ByVal graphics As Long, contrast As Long) AS LONG 
declare function GdipSetInterpolationMode Lib "gdiplus" ALIAS "GdipSetInterpolationMode" (ByVal graphics As Long, ByVal interpolation As long) AS LONG 
declare function GdipGetInterpolationMode Lib "gdiplus" ALIAS "GdipGetInterpolationMode" (ByVal graphics As Long, interpolation As long) AS LONG 
declare function GdipSetWorldTransform Lib "gdiplus" ALIAS "GdipSetWorldTransform" (ByVal graphics As Long, ByVal matrix As Long) AS LONG 
declare function GdipResetWorldTransform Lib "gdiplus" ALIAS "GdipResetWorldTransform" (ByVal graphics As Long) AS LONG 
declare function GdipMultiplyWorldTransform Lib "gdiplus" ALIAS "GdipMultiplyWorldTransform" (ByVal graphics As Long, ByVal matrix As Long, ByVal order As long) AS LONG 
declare function GdipTranslateWorldTransform Lib "gdiplus" ALIAS "GdipTranslateWorldTransform" (ByVal graphics As Long, ByVal dx As Single, ByVal dy As Single, ByVal order As long) AS LONG 
declare function GdipScaleWorldTransform Lib "gdiplus" ALIAS "GdipScaleWorldTransform" (ByVal graphics As Long, ByVal sx As Single, ByVal sy As Single, ByVal order As long) AS LONG 
declare function GdipRotateWorldTransform Lib "gdiplus" ALIAS "GdipRotateWorldTransform" (ByVal graphics As Long, ByVal angle As Single, ByVal order As long) AS LONG 
declare function GdipGetWorldTransform Lib "gdiplus" ALIAS "GdipGetWorldTransform" (ByVal graphics As Long, ByVal matrix As Long) AS LONG 
declare function GdipResetPageTransform Lib "gdiplus" ALIAS "GdipResetPageTransform" (ByVal graphics As Long) AS LONG 
declare function GdipGetPageUnit Lib "gdiplus" ALIAS "GdipGetPageUnit" (ByVal graphics As Long, unit As long) AS LONG 
declare function GdipGetPageScale Lib "gdiplus" ALIAS "GdipGetPageScale" (ByVal graphics As Long, sscale As Single) AS LONG 
declare function GdipSetPageUnit Lib "gdiplus" ALIAS "GdipSetPageUnit" (ByVal graphics As Long, ByVal unit As long) AS LONG 
declare function GdipSetPageScale Lib "gdiplus" ALIAS "GdipSetPageScale" (ByVal graphics As Long, ByVal sscale As Single) AS LONG 
declare function GdipGetDpiX Lib "gdiplus" ALIAS "GdipGetDpiX" (ByVal graphics As Long, dpi As Single) AS LONG 
declare function GdipGetDpiY Lib "gdiplus" ALIAS "GdipGetDpiY" (ByVal graphics As Long, dpi As Single) AS LONG 
declare function GdipTransformPoints Lib "gdiplus" ALIAS "GdipTransformPoints" (ByVal graphics As Long, ByVal destSpace As long, ByVal srcSpace As long, Points As long, ByVal count As Long) AS LONG 
declare function GdipTransformPointsI Lib "gdiplus" ALIAS "GdipTransformPointsI" (ByVal graphics As Long, ByVal destSpace As long, ByVal srcSpace As long, Points As long, ByVal count As Long) AS LONG 
declare function GdipGetNearestColor Lib "gdiplus" ALIAS "GdipGetNearestColor" (ByVal graphics As Long, argb As Long) AS LONG 
' Creates the Win9x Halftone ALIAS "the" Palette (even on NT) with correct Desktop colors 
declare function GdipCreateHalftonePalette Lib "gdiplus" ALIAS "GdipCreateHalftonePalette" () As Long 
declare function GdipDrawLine Lib "gdiplus" ALIAS "GdipDrawLine" (ByVal graphics As Long, ByVal pen As Long, ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single) AS LONG 
declare function GdipDrawLineI Lib "gdiplus" ALIAS "GdipDrawLineI" (ByVal graphics As Long, ByVal pen As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) AS LONG 
declare function GdipDrawLines Lib "gdiplus" ALIAS "GdipDrawLines" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawLinesI Lib "gdiplus" ALIAS "GdipDrawLinesI" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipDrawArc Lib "gdiplus" ALIAS "GdipDrawArc" (ByVal graphics As Long, ByVal pen As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal startAngle As Single,
'declare function GdipDrawArcI Lib "gdiplus" ALIAS "GdipDrawArcI" (ByVal graphics As Long, ByVal pen As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, ByVal startAngle As Single,
'declare function GdipDrawBezier Lib "gdiplus" ALIAS "GdipDrawBezier" (ByVal graphics As Long, ByVal pen As Long, ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single, ByVal x3 As Single,
'declare function GdipDrawBezierI Lib "gdiplus" ALIAS "GdipDrawBezierI" (ByVal graphics As Long, ByVal pen As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal x3 As Long,
declare function GdipDrawBeziers Lib "gdiplus" ALIAS "GdipDrawBeziers" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawBeziersI Lib "gdiplus" ALIAS "GdipDrawBeziersI" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawRectangle Lib "gdiplus" ALIAS "GdipDrawRectangle" (ByVal graphics As Long, ByVal pen As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) AS LONG 
declare function GdipDrawRectangleI Lib "gdiplus" ALIAS "GdipDrawRectangleI" (ByVal graphics As Long, ByVal pen As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long) AS LONG 
declare function GdipDrawRectangles Lib "gdiplus" ALIAS "GdipDrawRectangles" (ByVal graphics As Long, ByVal pen As Long, rects As long, ByVal count As Long) AS LONG 
declare function GdipDrawRectanglesI Lib "gdiplus" ALIAS "GdipDrawRectanglesI" (ByVal graphics As Long, ByVal pen As Long, rects As long, ByVal count As Long) AS LONG 
declare function GdipDrawEllipse Lib "gdiplus" ALIAS "GdipDrawEllipse" (ByVal graphics As Long, ByVal pen As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) AS LONG 
declare function GdipDrawEllipseI Lib "gdiplus" ALIAS "GdipDrawEllipseI" (ByVal graphics As Long, ByVal pen As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long) AS LONG 
'declare function GdipDrawPie Lib "gdiplus" ALIAS "GdipDrawPie" (ByVal graphics As Long, ByVal pen As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal startAngle As Single,
'declare function GdipDrawPieI Lib "gdiplus" ALIAS "GdipDrawPieI" (ByVal graphics As Long, ByVal pen As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, ByVal startAngle As Single,
declare function GdipDrawPolygon Lib "gdiplus" ALIAS "GdipDrawPolygon" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawPolygonI Lib "gdiplus" ALIAS "GdipDrawPolygonI" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawPath Lib "gdiplus" ALIAS "GdipDrawPath" (ByVal graphics As Long, ByVal pen As Long, ByVal path As Long) AS LONG 
declare function GdipDrawCurve Lib "gdiplus" ALIAS "GdipDrawCurve" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawCurveI Lib "gdiplus" ALIAS "GdipDrawCurveI" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawCurve2 Lib "gdiplus" ALIAS "GdipDrawCurve2" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long, ByVal tension As Single) AS LONG 
declare function GdipDrawCurve2I Lib "gdiplus" ALIAS "GdipDrawCurve2I" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long, ByVal tension As Single) AS LONG 
declare function GdipDrawCurve3 Lib "gdiplus" ALIAS "GdipDrawCurve3" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long, ByVal Offset As Long, ByVal numberOfSegments As Long, ByVal tension As Single) AS LONG
declare function GdipDrawCurve3I Lib "gdiplus" ALIAS "GdipDrawCurve3I" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long, ByVal Offset As Long, ByVal numberOfSegments As Long, ByVal tension As Single) AS LONG
declare function GdipDrawClosedCurve Lib "gdiplus" ALIAS "GdipDrawClosedCurve" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawClosedCurveI Lib "gdiplus" ALIAS "GdipDrawClosedCurveI" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipDrawClosedCurve2 Lib "gdiplus" ALIAS "GdipDrawClosedCurve2" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long, ByVal tension As Single) AS LONG 
declare function GdipDrawClosedCurve2I Lib "gdiplus" ALIAS "GdipDrawClosedCurve2I" (ByVal graphics As Long, ByVal pen As Long, Points As long, ByVal count As Long, ByVal tension As Single) AS LONG 
declare function GdipGraphicsClear Lib "gdiplus" ALIAS "GdipGraphicsClear" (ByVal graphics As Long, ByVal lColor As Long) AS LONG 
declare function GdipFillRectangle Lib "gdiplus" ALIAS "GdipFillRectangle" (ByVal graphics As Long, ByVal brush As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) AS LONG 
declare function GdipFillRectangleI Lib "gdiplus" ALIAS "GdipFillRectangleI" (ByVal graphics As Long, ByVal brush As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long) AS LONG 
declare function GdipFillRectangles Lib "gdiplus" ALIAS "GdipFillRectangles" (ByVal graphics As Long, ByVal brush As Long, rects As long, ByVal count As Long) AS LONG 
declare function GdipFillRectanglesI Lib "gdiplus" ALIAS "GdipFillRectanglesI" (ByVal graphics As Long, ByVal brush As Long, rects As long, ByVal count As Long) AS LONG 
declare function GdipFillPolygon Lib "gdiplus" ALIAS "GdipFillPolygon" (ByVal graphics As Long, ByVal brush As Long, Points As long, ByVal count As Long, ByVal FillMd As Long) AS LONG 
declare function GdipFillPolygonI Lib "gdiplus" ALIAS "GdipFillPolygonI" (ByVal graphics As Long, ByVal brush As Long, Points As long, ByVal count As Long, ByVal FillMd As Long) AS LONG 
declare function GdipFillPolygon2 Lib "gdiplus" ALIAS "GdipFillPolygon2" (ByVal graphics As Long, ByVal brush As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipFillPolygon2I Lib "gdiplus" ALIAS "GdipFillPolygon2I" (ByVal graphics As Long, ByVal brush As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipFillEllipse Lib "gdiplus" ALIAS "GdipFillEllipse" (ByVal graphics As Long, ByVal brush As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) AS LONG 
declare function GdipFillEllipseI Lib "gdiplus" ALIAS "GdipFillEllipseI" (ByVal graphics As Long, ByVal brush As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long) AS LONG 
'declare function GdipFillPie Lib "gdiplus" ALIAS "GdipFillPie" (ByVal graphics As Long, ByVal brush As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal startAngle As Single,
'declare function GdipFillPieI Lib "gdiplus" ALIAS "GdipFillPieI" (ByVal graphics As Long, ByVal brush As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, ByVal startAngle As Single,
declare function GdipFillPath Lib "gdiplus" ALIAS "GdipFillPath" (ByVal graphics As Long, ByVal brush As Long, ByVal path As Long) AS LONG 
declare function GdipFillClosedCurve Lib "gdiplus" ALIAS "GdipFillClosedCurve" (ByVal graphics As Long, ByVal brush As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipFillClosedCurveI Lib "gdiplus" ALIAS "GdipFillClosedCurveI" (ByVal graphics As Long, ByVal brush As Long, Points As long, ByVal count As Long) AS LONG 
declare function GdipFillClosedCurve2 Lib "gdiplus" ALIAS "GdipFillClosedCurve2" (ByVal graphics As Long, ByVal brush As Long, Points As long, ByVal count As Long, ByVal tension As Single, ByVal FillMd As Long) AS LONG 
declare function GdipFillClosedCurve2I Lib "gdiplus" ALIAS "GdipFillClosedCurve2I" (ByVal graphics As Long, ByVal brush As Long, Points As long, ByVal count As Long, ByVal tension As Single, ByVal FillMd As Long) AS LONG 
declare function GdipFillRegion Lib "gdiplus" ALIAS "GdipFillRegion" (ByVal graphics As Long, ByVal brush As Long, ByVal region As Long) AS LONG 
declare function GdipDrawImage Lib "gdiplus" ALIAS "GdipDrawImage" (ByVal graphics As Long, ByVal image As Long, ByVal x As Single, ByVal y As Single) AS LONG 
declare function GdipDrawImageI Lib "gdiplus" ALIAS "GdipDrawImageI" (ByVal graphics As Long, ByVal image As Long, ByVal x As Long, ByVal y As Long) AS LONG 
declare function GdipDrawImageRect Lib "gdiplus" ALIAS "GdipDrawImageRect" (ByVal graphics As Long, ByVal image As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) AS LONG 
declare function GdipDrawImageRectI Lib "gdiplus" ALIAS "GdipDrawImageRectI" (ByVal graphics As Long, ByVal image As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long) AS LONG 
declare function GdipDrawImagePoints Lib "gdiplus" ALIAS "GdipDrawImagePoints" (ByVal graphics As Long, ByVal image As Long, dstpoints As long, ByVal count As Long) AS LONG 
declare function GdipDrawImagePointsI Lib "gdiplus" ALIAS "GdipDrawImagePointsI" (ByVal graphics As Long, ByVal image As Long, dstpoints As long, ByVal count As Long) AS LONG 
'declare function GdipDrawImagePointRect Lib "gdiplus" ALIAS "GdipDrawImagePointRect" (ByVal graphics As Long, ByVal image As Long, ByVal x As Single, ByVal y As Single, ByVal srcx As Single, ByVal srcy As Single, ByVal srcwidth As Single,
'declare function GdipDrawImagePointRectI Lib "gdiplus" ALIAS "GdipDrawImagePointRectI" (ByVal graphics As Long, ByVal image As Long, ByVal x As Long, ByVal y As Long, ByVal srcx As Long, ByVal srcy As Long, ByVal srcwidth As Long,
'declare function GdipDrawImageRectRect Lib "gdiplus" ALIAS "GdipDrawImageRectRect" (ByVal graphics As Long, ByVal image As Long, ByVal dstx As Single, ByVal dsty As Single, ByVal dstwidth As Long, ByVal dstheight As Single, ByVal srcx As Single,
' Callback declaration: Public Function ALIAS "declaration:" DrawImageAbort(ByVal lpData as Long) as Long 
'declare function GdipDrawImageRectRectI Lib "gdiplus" ALIAS "GdipDrawImageRectRectI" (ByVal graphics As Long, ByVal image As Long, ByVal dstx As Long, ByVal dsty As Long, ByVal dstwidth As Long, ByVal dstheight As Long, ByVal srcx As Long,
'declare function GdipDrawImagePointsRect Lib "gdiplus" ALIAS "GdipDrawImagePointsRect" (ByVal graphics As Long, ByVal image As Long, Points As long, ByVal count As Long, ByVal srcx As Single, ByVal srcy As Single, ByVal srcwidth As Single, ByVal
'declare function GdipDrawImagePointsRectI Lib "gdiplus" ALIAS "GdipDrawImagePointsRectI" (ByVal graphics As Long, ByVal image As Long, Points As long, ByVal count As Long, ByVal srcx As Long, ByVal srcy As Long, ByVal srcwidth As Long, ByVal
declare function GdipEnumerateMetafileDestPoint Lib "gdiplus" ALIAS "GdipEnumerateMetafileDestPoint" (ByVal graphics As Long, ByVal metafile As Long, destPoint As long, lpEnumerateMetafileProc As Long, ByVal callbackData As Long, imageAttributes As Long) AS LONG 
' Callback declaration: Public Function ALIAS "declaration:" EnumMetafilesProc(Byval rtype as EmfPlusRecordType, byval _ as Long, byval _ as Long, bytes as Any, byval callbackData as long) as long 
declare function GdipEnumerateMetafileDestPointI Lib "gdiplus" ALIAS "GdipEnumerateMetafileDestPointI" (graphics As Long, ByVal metafile As Long, destPoint As long, ByVal lpEnumerateMetafileProc As Long, ByVal callbackData As Long, ByVal imageAttributes As Long) AS LONG 
declare function GdipEnumerateMetafileDestRect Lib "gdiplus" ALIAS "GdipEnumerateMetafileDestRect" (ByVal graphics As Long, ByVal metafile As Long, destRect As long, lpEnumerateMetafileProc As Long, ByVal callbackData As Long, imageAttributes As Long) AS LONG 
declare function GdipEnumerateMetafileDestRectI Lib "gdiplus" ALIAS "GdipEnumerateMetafileDestRectI" (ByVal graphics As Long, ByVal metafile As Long, destRect As long, lpEnumerateMetafileProc As Long, ByVal callbackData As Long, imageAttributes As Long) AS LONG 
declare function GdipEnumerateMetafileDestPoints Lib "gdiplus" ALIAS "GdipEnumerateMetafileDestPoints" (ByVal graphics As Long, ByVal metafile As Long, destPoint As long, ByVal count As Long, lpEnumerateMetafileProc As Long, ByVal callbackData As Long, imageAttributes As Long) AS LONG 
declare function GdipEnumerateMetafileDestPointsI Lib "gdiplus" ALIAS "GdipEnumerateMetafileDestPointsI" (ByVal graphics As Long, ByVal metafile As Long, destPoint As long, ByVal count As Long, lpEnumerateMetafileProc As Long, ByVal callbackData As Long, imageAttributes As Long) AS LONG 
'declare function GdipEnumerateMetafileSrcRectDestPoint Lib "gdiplus" ALIAS "GdipEnumerateMetafileSrcRectDestPoint" (ByVal graphics As Long, ByVal metafile As Long, destPoint As long, srcRect As long, ByVal srcUnit As GpUnit, ByVal lpEnumerateMetafileProc As Long, ByVal callbackData As Long, ByVal imageAttributes
'declare function GdipEnumerateMetafileSrcRectDestPointI Lib "gdiplus" ALIAS "GdipEnumerateMetafileSrcRectDestPointI" (ByVal graphics As Long, ByVal metafile As Long, destPoint As long, srcRect As long, ByVal srcUnit As GpUnit, ByVal lpEnumerateMetafileProc As Long, ByVal callbackData As Long, ByVal imageAttributes
'declare function GdipEnumerateMetafileSrcRectDestRect Lib "gdiplus" ALIAS "GdipEnumerateMetafileSrcRectDestRect" (ByVal graphics As Long, ByVal metafile As Long, destRect As long, srcRect As long, ByVal srcUnit As GpUnit, ByVal lpEnumerateMetafileProc As Long, ByVal callbackData As Long, ByVal imageAttributes
'declare function GdipEnumerateMetafileSrcRectDestRectI Lib "gdiplus" ALIAS "GdipEnumerateMetafileSrcRectDestRectI" (ByVal graphics As Long, ByVal metafile As Long, destRect As long, srcRect As long, ByVal srcUnit As GpUnit, ByVal lpEnumerateMetafileProc As Long, ByVal callbackData As Long, ByVal imageAttributes
'declare function GdipEnumerateMetafileSrcRectDestPoints Lib "gdiplus" ALIAS "GdipEnumerateMetafileSrcRectDestPoints" (ByVal graphics As Long, ByVal metafile As Long, destPoints As long, ByVal count As Long, srcRect As long, ByVal srcUnit As GpUnit, ByVal lpEnumerateMetafileProc As Long, ByVal callbackData
'declare function GdipEnumerateMetafileSrcRectDestPointsI Lib "gdiplus" ALIAS "GdipEnumerateMetafileSrcRectDestPointsI" (ByVal graphics As Long, ByVal metafile As Long, destPoints As long, ByVal count As Long, srcRect As long, ByVal srcUnit As GpUnit, ByVal lpEnumerateMetafileProc As Long, ByVal callbackData
'declare function GdipPlayMetafileRecord Lib "gdiplus" ALIAS "GdipPlayMetafileRecord" (ByVal metafile As Long, ByVal recordType As EmfPlusRecordType, ByVal flags As Long, ByVal dataSize As Long, byteData As Any) AS LONG 
declare function GdipSetClipGraphics Lib "gdiplus" ALIAS "GdipSetClipGraphics" (ByVal graphics As Long, ByVal srcgraphics As Long, ByVal CombineMd As long) AS LONG 
declare function GdipSetClipRect Lib "gdiplus" ALIAS "GdipSetClipRect" (ByVal graphics As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal CombineMd As long) AS LONG 
declare function GdipSetClipRectI Lib "gdiplus" ALIAS "GdipSetClipRectI" (ByVal graphics As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, ByVal CombineMd As long) AS LONG 
declare function GdipSetClipPath Lib "gdiplus" ALIAS "GdipSetClipPath" (ByVal graphics As Long, ByVal path As Long, ByVal CombineMd As long) AS LONG 
declare function GdipSetClipRegion Lib "gdiplus" ALIAS "GdipSetClipRegion" (ByVal graphics As Long, ByVal region As Long, ByVal CombineMd As long) AS LONG 
declare function GdipSetClipHrgn Lib "gdiplus" ALIAS "GdipSetClipHrgn" (ByVal graphics As Long, ByVal hRgn As Long, ByVal CombineMd As long) AS LONG 
declare function GdipResetClip Lib "gdiplus" ALIAS "GdipResetClip" (ByVal graphics As Long) AS LONG 
declare function GdipTranslateClip Lib "gdiplus" ALIAS "GdipTranslateClip" (ByVal graphics As Long, ByVal dx As Single, ByVal dy As Single) AS LONG 
declare function GdipTranslateClipI Lib "gdiplus" ALIAS "GdipTranslateClipI" (ByVal graphics As Long, ByVal dx As Long, ByVal dy As Long) AS LONG 
declare function GdipGetClip Lib "gdiplus" ALIAS "GdipGetClip" (ByVal graphics As Long, ByVal region As Long) AS LONG 
declare function GdipGetClipBounds Lib "gdiplus" ALIAS "GdipGetClipBounds" (ByVal graphics As Long, rect As long) AS LONG 
declare function GdipGetClipBoundsI Lib "gdiplus" ALIAS "GdipGetClipBoundsI" (ByVal graphics As Long, rect As long) AS LONG 
declare function GdipIsClipEmpty Lib "gdiplus" ALIAS "GdipIsClipEmpty" (ByVal graphics As Long, result As Long) AS LONG 
declare function GdipGetVisibleClipBounds Lib "gdiplus" ALIAS "GdipGetVisibleClipBounds" (ByVal graphics As Long, rect As long) AS LONG 
declare function GdipGetVisibleClipBoundsI Lib "gdiplus" ALIAS "GdipGetVisibleClipBoundsI" (ByVal graphics As Long, rect As long) AS LONG 
declare function GdipIsVisibleClipEmpty Lib "gdiplus" ALIAS "GdipIsVisibleClipEmpty" (ByVal graphics As Long, result As Long) AS LONG 
declare function GdipIsVisiblePoint Lib "gdiplus" ALIAS "GdipIsVisiblePoint" (ByVal graphics As Long, ByVal x As Single, ByVal y As Single, result As Long) AS LONG 
declare function GdipIsVisiblePointI Lib "gdiplus" ALIAS "GdipIsVisiblePointI" (ByVal graphics As Long, ByVal x As Long, ByVal y As Long, result As Long) AS LONG 
declare function GdipIsVisibleRect Lib "gdiplus" ALIAS "GdipIsVisibleRect" (ByVal graphics As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, result As Long) AS LONG 
declare function GdipIsVisibleRectI Lib "gdiplus" ALIAS "GdipIsVisibleRectI" (ByVal graphics As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, result As Long) AS LONG 
declare function GdipSaveGraphics Lib "gdiplus" ALIAS "GdipSaveGraphics" (ByVal graphics As Long, state As Long) AS LONG 
declare function GdipRestoreGraphics Lib "gdiplus" ALIAS "GdipRestoreGraphics" (ByVal graphics As Long, ByVal state As Long) AS LONG 
declare function GdipBeginContainer Lib "gdiplus" ALIAS "GdipBeginContainer" (ByVal graphics As Long, dstrect As long, srcRect As long, ByVal unit As long, state As Long) AS LONG 
declare function GdipBeginContainerI Lib "gdiplus" ALIAS "GdipBeginContainerI" (ByVal graphics As Long, dstrect As long, srcRect As long, ByVal unit As long, state As Long) AS LONG 
declare function GdipBeginContainer2 Lib "gdiplus" ALIAS "GdipBeginContainer2" (ByVal graphics As Long, state As Long) AS LONG 
declare function GdipEndContainer Lib "gdiplus" ALIAS "GdipEndContainer" (ByVal graphics As Long, ByVal state As Long) AS LONG 
'declare function GdipGetMetafileHeaderFromWmf Lib "gdiplus" ALIAS "GdipGetMetafileHeaderFromWmf" (ByVal hWmf As Long, WmfPlaceableFileHdr As WmfPlaceableFileHeader, header As MetafileHeader) AS LONG 
'declare function GdipGetMetafileHeaderFromEmf Lib "gdiplus" ALIAS "GdipGetMetafileHeaderFromEmf" (ByVal hEmf As Long, header As MetafileHeader) AS LONG 
'declare function GdipGetMetafileHeaderFromFile Lib "gdiplus" ALIAS "GdipGetMetafileHeaderFromFile" (ByVal filename As String, header As MetafileHeader) AS LONG 
' TODO: Uncomment if you ALIAS "Uncomment" have the IStream object declared, or equivalent 
'Declare Function GdipGetMetafileHeaderFromStream Lib "gdiplus" ALIAS "GdipGetMetafileHeaderFromStream" (Byval stream as IStream, header As MetafileHeader) AS LONG 
'declare function GdipGetMetafileHeaderFromMetafile Lib "gdiplus" ALIAS "GdipGetMetafileHeaderFromMetafile" (ByVal metafile As Long, header As MetafileHeader) AS LONG 
'declare function GdipGetHemfFromMetafile Lib "gdiplus" ALIAS "GdipGetHemfFromMetafile" (ByVal metafile As Long, hEmf As Long) AS LONG 
' TODO: Uncomment if you ALIAS "Uncomment" have the IStream object declared, or equivalent 
' NOTE: The C++ stream ALIAS "The" parameter was declared as IStream** stream 
Declare Function GdipCreateStreamOnFile Lib "gdiplus" ALIAS "GdipCreateStreamOnFile" (ByVal filename As String, ByVal access As Long, stream As long) AS LONG 
'declare function GdipCreateMetafileFromWmf Lib "gdiplus" ALIAS "GdipCreateMetafileFromWmf" (ByVal hWmf As Long, ByVal bDeleteWmf As Long, WmfPlaceableFileHdr As WmfPlaceableFileHeader, ByVal metafile As Long) AS LONG 
'declare function GdipCreateMetafileFromEmf Lib "gdiplus" ALIAS "GdipCreateMetafileFromEmf" (ByVal hEmf As Long, ByVal bDeleteEmf As Long, metafile As Long) AS LONG 
'declare function GdipCreateMetafileFromFile Lib "gdiplus" ALIAS "GdipCreateMetafileFromFile" (byvalfile As String, metafile As Long) AS LONG 
'declare function GdipCreateMetafileFromWmfFile Lib "gdiplus" ALIAS "GdipCreateMetafileFromWmfFile" (ByVal file As String, WmfPlaceableFileHdr As WmfPlaceableFileHeader, metafile As Long) AS LONG 
'' TODO: Uncomment if you ALIAS "Uncomment" have the IStream object declared, or equivalent 
'Declare Function GdipCreateMetafileFromStream Lib "gdiplus" ALIAS "GdipCreateMetafileFromStream" (Byval stream as IStream, metafile As Long) AS LONG 
'declare function GdipRecordMetafile Lib "gdiplus" ALIAS "GdipRecordMetafile" (ByVal referenceHdc As Long, etype As EmfType, frameRect As long, ByVal frameUnit As MetafileFrameUnit, ByVal description As String, metafile As Long) AS LONG 
'declare function GdipRecordMetafileI Lib "gdiplus" ALIAS "GdipRecordMetafileI" (ByVal referenceHdc As Long, etype As EmfType, frameRect As long, ByVal frameUnit As MetafileFrameUnit, ByVal description As String, metafile As Long) AS LONG 
'declare function GdipRecordMetafileFileName Lib "gdiplus" ALIAS "GdipRecordMetafileFileName" (ByVal filename As String, ByVal referenceHdc As Long, etype As EmfType, frameRect As long, ByVal frameUnit As MetafileFrameUnit, ByVal description As String, metafile As Long) AS LONG 
'declare function GdipRecordMetafileFileNameI Lib "gdiplus" ALIAS "GdipRecordMetafileFileNameI" (ByVal filename As String, ByVal referenceHdc As Long, etype As EmfType, frameRect As long, ByVal frameUnit As MetafileFrameUnit, ByVal description As String, metafile As Long) AS LONG 
'' TODO: Uncomment if you ALIAS "Uncomment" have the IStream object declared, or equivalent 
'Declare Function GdipRecordMetafileStream Lib "gdiplus" ALIAS "GdipRecordMetafileStream" (Byval stream as IStream, ByVal referenceHdc As Long, etype As EmfType, frameRect As long, ByVal frameUnit As MetafileFrameUnit, ByVal description As String, metafile As Long) AS LONG 
'Declare Function GdipRecordMetafileStreamI Lib "gdiplus" ALIAS "GdipRecordMetafileStreamI" (Byval stream as IStream, ByVal referenceHdc As Long, etype As EmfType, frameRect As long, ByVal frameUnit As MetafileFrameUnit, ByVal description As String, metafile As Long) AS LONG 
declare function GdipSetMetafileDownLevelRasterizationLimit Lib "gdiplus" ALIAS "GdipSetMetafileDownLevelRasterizationLimit" (ByVal metafile As Long, ByVal metafileRasterizationLimitDpi As Long) AS LONG 
declare function GdipGetMetafileDownLevelRasterizationLimit Lib "gdiplus" ALIAS "GdipGetMetafileDownLevelRasterizationLimit" (ByVal metafile As Long, metafileRasterizationLimitDpi As Long) AS LONG 
' NOTE: These encoders/decoders functions ALIAS "These" expect an ImageCodecInfo array 
declare function GdipGetImageDecodersSize Lib "gdiplus" ALIAS "GdipGetImageDecodersSize" (numDecoders As Long, size As Long) AS LONG 
declare function GdipGetImageDecoders Lib "gdiplus" ALIAS "GdipGetImageDecoders" (ByVal numDecoders As Long, ByVal size As Long, decoders As long) AS LONG 
declare function GdipGetImageEncodersSize Lib "gdiplus" ALIAS "GdipGetImageEncodersSize" (numEncoders As Long, size As Long) AS LONG 
declare function GdipGetImageEncoders Lib "gdiplus" ALIAS "GdipGetImageEncoders" (ByVal numEncoders As Long, ByVal size As Long, encoders As long) AS LONG 
declare function GdipComment Lib "gdiplus" ALIAS "GdipComment" (ByVal graphics As Long, ByVal sizeData As Long, data As long) AS LONG 

' Image Functions (ALL) ALIAS "Functions" 
declare function GdipLoadImageFromFile Lib "gdiplus" ALIAS "GdipLoadImageFromFile" (ByVal filename As String, image As Long) AS LONG 
declare function GdipLoadImageFromFileICM Lib "gdiplus" ALIAS "GdipLoadImageFromFileICM" (ByVal filename As String, image As Long) AS LONG 
' TODO: Uncomment if you ALIAS "Uncomment" have the IStream object declared, or equivalent 
Declare Function GdipLoadImageFromStream Lib "gdiplus" ALIAS "GdipLoadImageFromStream" (Byval stream As long, image As Long) AS LONG 
Declare Function GdipLoadImageFromStreamICM Lib "gdiplus" ALIAS "GdipLoadImageFromStreamICM" (Byval stream As long, image As Long) AS LONG 
declare function GdipDisposeImage Lib "gdiplus" ALIAS "GdipDisposeImage" (ByVal image As Long) AS LONG 
declare function GdipCloneImage Lib "gdiplus" ALIAS "GdipCloneImage" (ByVal image As Long, cloneImage As Long) AS LONG 
' NOTE: The encoderParams parameter ALIAS "The" expects a EncoderParameters struct or a NULL 
declare function GdipSaveImageToFile Lib "gdiplus" ALIAS "GdipSaveImageToFile" (ByVal image As Long, ByVal filename As String, clsidEncoder As long, encoderParams As long) AS LONG 
' TODO: Uncomment if you ALIAS "Uncomment" have the IStream object declared, or equivalent 
Declare Function GdipSaveImageToStream Lib "gdiplus" ALIAS "GdipSaveImageToStream" (ByVal image As Long, ByVal stream As long, clsidEncoder As long, encoderParams As long) AS LONG 
declare function GdipSaveAdd Lib "gdiplus" ALIAS "GdipSaveAdd" (ByVal image As Long, encoderParams As long) AS LONG 
declare function GdipSaveAddImage Lib "gdiplus" ALIAS "GdipSaveAddImage" (ByVal image As Long, ByVal newImage As Long, encoderParams As long) AS LONG 
declare function GdipGetImageGraphicsContext Lib "gdiplus" ALIAS "GdipGetImageGraphicsContext" (ByVal image As Long, graphics As Long) AS LONG 
declare function GdipGetImageBounds Lib "gdiplus" ALIAS "GdipGetImageBounds" (ByVal image As Long, srcRect As long, srcUnit As long) AS LONG 
declare function GdipGetImageDimension Lib "gdiplus" ALIAS "GdipGetImageDimension" (ByVal image As Long, Width As Single, Height As Single) AS LONG 
declare function GdipGetImageType Lib "gdiplus" ALIAS "GdipGetImageType" (ByVal image As Long, itype As long) AS LONG 
declare function GdipGetImageWidth Lib "gdiplus" ALIAS "GdipGetImageWidth" (ByVal image As Long, Width As Long) AS LONG 
declare function GdipGetImageHeight Lib "gdiplus" ALIAS "GdipGetImageHeight" (ByVal image As Long, Height As Long) AS LONG 
declare function GdipGetImageHorizontalResolution Lib "gdiplus" ALIAS "GdipGetImageHorizontalResolution" (ByVal image As Long, resolution As Single) AS LONG 
declare function GdipGetImageVerticalResolution Lib "gdiplus" ALIAS "GdipGetImageVerticalResolution" (ByVal image As Long, resolution As Single) AS LONG 
declare function GdipGetImageFlags Lib "gdiplus" ALIAS "GdipGetImageFlags" (ByVal image As Long, flags As Long) AS LONG 
declare function GdipGetImageRawFormat Lib "gdiplus" ALIAS "GdipGetImageRawFormat" (ByVal image As Long, format As long) AS LONG 
declare function GdipGetImagePixelFormat Lib "gdiplus" ALIAS "GdipGetImagePixelFormat" (ByVal image As Long, PixelFormat As Long) AS LONG 
'declare function GdipGetImageThumbnail Lib "gdiplus" ALIAS "GdipGetImageThumbnail" (ByVal image As Long, ByVal thumbWidth As Long, ByVal thumbHeight As Long, thumbImage As Long, Optional ByVal callback As Long = 0, Optional ByVal callbackData As Long =
declare function GdipGetEncoderParameterListSize Lib "gdiplus" ALIAS "GdipGetEncoderParameterListSize" (ByVal image As Long, clsidEncoder As long, size As Long) AS LONG 
declare function GdipGetEncoderParameterList Lib "gdiplus" ALIAS "GdipGetEncoderParameterList" (ByVal image As Long, clsidEncoder As long, ByVal size As Long, buffer As long) AS LONG 
declare function GdipImageGetFrameDimensionsCount Lib "gdiplus" ALIAS "GdipImageGetFrameDimensionsCount" (ByVal image As Long, count As Long) AS LONG 
declare function GdipImageGetFrameDimensionsList Lib "gdiplus" ALIAS "GdipImageGetFrameDimensionsList" (ByVal image As Long, dimensionIDs As long, ByVal count As Long) AS LONG 
declare function GdipImageGetFrameCount Lib "gdiplus" ALIAS "GdipImageGetFrameCount" (ByVal image As Long, dimensionID As long, count As Long) AS LONG 
declare function GdipImageSelectActiveFrame Lib "gdiplus" ALIAS "GdipImageSelectActiveFrame" (ByVal image As Long, dimensionID As long, ByVal frameIndex As Long) AS LONG 
declare function GdipImageRotateFlip Lib "gdiplus" ALIAS "GdipImageRotateFlip" (ByVal image As Long, ByVal rfType As long) AS LONG 
declare function GdipGetImagePalette Lib "gdiplus" ALIAS "GdipGetImagePalette" (ByVal image As Long, palette As long, ByVal size As Long) AS LONG 
declare function GdipSetImagePalette Lib "gdiplus" ALIAS "GdipSetImagePalette" (ByVal image As Long, palette As long) AS LONG 
declare function GdipGetImagePaletteSize Lib "gdiplus" ALIAS "GdipGetImagePaletteSize" (ByVal image As Long, size As Long) AS LONG 
declare function GdipGetPropertyCount Lib "gdiplus" ALIAS "GdipGetPropertyCount" (ByVal image As Long, numOfProperty As Long) AS LONG 
declare function GdipGetPropertyIdList Lib "gdiplus" ALIAS "GdipGetPropertyIdList" (ByVal image As Long, ByVal numOfProperty As Long, list As Long) AS LONG 
declare function GdipGetPropertyItemSize Lib "gdiplus" ALIAS "GdipGetPropertyItemSize" (ByVal image As Long, ByVal propId As Long, size As Long) AS LONG 
declare function GdipGetPropertyItem Lib "gdiplus" ALIAS "GdipGetPropertyItem" (ByVal image As Long, ByVal propId As Long, ByVal propSize As Long, buffer As long) AS LONG 
declare function GdipGetPropertySize Lib "gdiplus" ALIAS "GdipGetPropertySize" (ByVal image As Long, totalBufferSize As Long, numProperties As Long) AS LONG 
declare function GdipGetAllPropertyItems Lib "gdiplus" ALIAS "GdipGetAllPropertyItems" (ByVal image As Long, ByVal totalBufferSize As Long, ByVal numProperties As Long, allItems As long) AS LONG 
declare function GdipRemovePropertyItem Lib "gdiplus" ALIAS "GdipRemovePropertyItem" (ByVal image As Long, ByVal propId As Long) AS LONG 
declare function GdipSetPropertyItem Lib "gdiplus" ALIAS "GdipSetPropertyItem" (ByVal image As Long, item As long) AS LONG 
declare function GdipImageForceValidation Lib "gdiplus" ALIAS "GdipImageForceValidation" (ByVal image As Long) AS LONG 

' Pen Functions (ALL) ALIAS "Functions" 
declare function GdipCreatePen1 Lib "gdiplus" ALIAS "GdipCreatePen1" (ByVal color As Long, ByVal Width As Single, ByVal unit As long, pen As Long) AS LONG 
declare function GdipCreatePen2 Lib "gdiplus" ALIAS "GdipCreatePen2" (ByVal brush As Long, ByVal Width As Single, ByVal unit As long, pen As Long) AS LONG 
declare function GdipClonePen Lib "gdiplus" ALIAS "GdipClonePen" (ByVal pen As Long, clonepen As Long) AS LONG 
declare function GdipDeletePen Lib "gdiplus" ALIAS "GdipDeletePen" (ByVal pen As Long) AS LONG 
declare function GdipSetPenWidth Lib "gdiplus" ALIAS "GdipSetPenWidth" (ByVal pen As Long, ByVal Width As Single) AS LONG 
declare function GdipGetPenWidth Lib "gdiplus" ALIAS "GdipGetPenWidth" (ByVal pen As Long, Width As Single) AS LONG 
declare function GdipSetPenUnit Lib "gdiplus" ALIAS "GdipSetPenUnit" (ByVal pen As Long, ByVal unit As long) AS LONG 
declare function GdipGetPenUnit Lib "gdiplus" ALIAS "GdipGetPenUnit" (ByVal pen As Long, unit As long) AS LONG 
'declare function GdipSetPenLineCap Lib "gdiplus" ALIAS "GdipSetPenLineCap197819" (ByVal pen As Long, ByVal startCap As LineCap, ByVal endCap As LineCap, ByVal dcap As DashCap) AS LONG 
'declare function GdipSetPenStartCap Lib "gdiplus" ALIAS "GdipSetPenStartCap" (ByVal pen As Long, ByVal startCap As LineCap) AS LONG 
'declare function GdipSetPenEndCap Lib "gdiplus" ALIAS "GdipSetPenEndCap" (ByVal pen As Long, ByVal endCap As LineCap) AS LONG 
'declare function GdipSetPenDashCap Lib "gdiplus" ALIAS "GdipSetPenDashCap" Alias "GdipSetPenDashCap197819" (ByVal pen As Long, ByVal dcap As DashCap) AS LONG 
'declare function GdipGetPenStartCap Lib "gdiplus" ALIAS "GdipGetPenStartCap" (ByVal pen As Long, startCap As LineCap) AS LONG 
'declare function GdipGetPenEndCap Lib "gdiplus" ALIAS "GdipGetPenEndCap" (ByVal pen As Long, endCap As LineCap) AS LONG 
'declare function GdipGetPenDashCap Lib "gdiplus" ALIAS "GdipGetPenDashCap" Alias "GdipGetPenDashCap197819" (ByVal pen As Long, dcap As DashCap) AS LONG 
'declare function GdipSetPenLineJoin Lib "gdiplus" ALIAS "GdipSetPenLineJoin" (ByVal pen As Long, ByVal LnJoin As LineJoin) AS LONG 
'declare function GdipGetPenLineJoin Lib "gdiplus" ALIAS "GdipGetPenLineJoin" (ByVal pen As Long, LnJoin As LineJoin) AS LONG 
'declare function GdipSetPenCustomStartCap Lib "gdiplus" ALIAS "GdipSetPenCustomStartCap" (ByVal pen As Long, ByVal customCap As Long) AS LONG 
'declare function GdipGetPenCustomStartCap Lib "gdiplus" ALIAS "GdipGetPenCustomStartCap" (ByVal pen As Long, customCap As Long) AS LONG 
'declare function GdipSetPenCustomEndCap Lib "gdiplus" ALIAS "GdipSetPenCustomEndCap" (ByVal pen As Long, ByVal customCap As Long) AS LONG 
'declare function GdipGetPenCustomEndCap Lib "gdiplus" ALIAS "GdipGetPenCustomEndCap" (ByVal pen As Long, customCap As Long) AS LONG 
'declare function GdipSetPenMiterLimit Lib "gdiplus" ALIAS "GdipSetPenMiterLimit" (ByVal pen As Long, ByVal miterLimit As Single) AS LONG 
'declare function GdipGetPenMiterLimit Lib "gdiplus" ALIAS "GdipGetPenMiterLimit" (ByVal pen As Long, miterLimit As Single) AS LONG 
declare function GdipSetPenMode Lib "gdiplus" ALIAS "GdipSetPenMode" (ByVal pen As Long, ByVal penMode As long) AS LONG 
declare function GdipGetPenMode Lib "gdiplus" ALIAS "GdipGetPenMode" (ByVal pen As Long, penMode As long) AS LONG 
declare function GdipSetPenTransform Lib "gdiplus" ALIAS "GdipSetPenTransform" (ByVal pen As Long, ByVal matrix As Long) AS LONG 
declare function GdipGetPenTransform Lib "gdiplus" ALIAS "GdipGetPenTransform" (ByVal pen As Long, ByVal matrix As Long) AS LONG 
declare function GdipResetPenTransform Lib "gdiplus" ALIAS "GdipResetPenTransform" (ByVal pen As Long) AS LONG 
declare function GdipMultiplyPenTransform Lib "gdiplus" ALIAS "GdipMultiplyPenTransform" (ByVal pen As Long, ByVal matrix As Long, ByVal order As long) AS LONG 
declare function GdipTranslatePenTransform Lib "gdiplus" ALIAS "GdipTranslatePenTransform" (ByVal pen As Long, ByVal dx As Single, ByVal dy As Single, ByVal order As long) AS LONG 
declare function GdipScalePenTransform Lib "gdiplus" ALIAS "GdipScalePenTransform" (ByVal pen As Long, ByVal sx As Single, ByVal sy As Single, ByVal order As long) AS LONG 
declare function GdipRotatePenTransform Lib "gdiplus" ALIAS "GdipRotatePenTransform" (ByVal pen As Long, ByVal angle As Single, ByVal order As long) AS LONG 
declare function GdipSetPenColor Lib "gdiplus" ALIAS "GdipSetPenColor" (ByVal pen As Long, ByVal argb As Long) AS LONG 
declare function GdipGetPenColor Lib "gdiplus" ALIAS "GdipGetPenColor" (ByVal pen As Long, argb As Long) AS LONG 
declare function GdipSetPenBrushFill Lib "gdiplus" ALIAS "GdipSetPenBrushFill" (ByVal pen As Long, ByVal brush As Long) AS LONG 
declare function GdipGetPenBrushFill Lib "gdiplus" ALIAS "GdipGetPenBrushFill" (ByVal pen As Long, brush As Long) AS LONG 
declare function GdipGetPenFillType Lib "gdiplus" ALIAS "GdipGetPenFillType" (ByVal pen As Long, ptype As long) AS LONG 
declare function GdipGetPenDashStyle Lib "gdiplus" ALIAS "GdipGetPenDashStyle" (ByVal pen As Long, dStyle As long) AS LONG 
declare function GdipSetPenDashStyle Lib "gdiplus" ALIAS "GdipSetPenDashStyle" (ByVal pen As Long, ByVal dStyle As long) AS LONG 
declare function GdipGetPenDashOffset Lib "gdiplus" ALIAS "GdipGetPenDashOffset" (ByVal pen As Long, Offset As Single) AS LONG 
declare function GdipSetPenDashOffset Lib "gdiplus" ALIAS "GdipSetPenDashOffset" (ByVal pen As Long, ByVal Offset As Single) AS LONG 
declare function GdipGetPenDashCount Lib "gdiplus" ALIAS "GdipGetPenDashCount" (ByVal pen As Long, count As Long) AS LONG 
declare function GdipSetPenDashArray Lib "gdiplus" ALIAS "GdipSetPenDashArray" (ByVal pen As Long, dash As Single, ByVal count As Long) AS LONG 
declare function GdipGetPenDashArray Lib "gdiplus" ALIAS "GdipGetPenDashArray" (ByVal pen As Long, dash As Single, ByVal count As Long) AS LONG 
declare function GdipGetPenCompoundCount Lib "gdiplus" ALIAS "GdipGetPenCompoundCount" (ByVal pen As Long, count As Long) AS LONG 
declare function GdipSetPenCompoundArray Lib "gdiplus" ALIAS "GdipSetPenCompoundArray" (ByVal pen As Long, dash As Single, ByVal count As Long) AS LONG 
declare function GdipGetPenCompoundArray Lib "gdiplus" ALIAS "GdipGetPenCompoundArray" (ByVal pen As Long, dash As Single, ByVal count As Long) AS LONG 

' CustomLineCap Functions (ALL) ALIAS "Functions" 
'declare function GdipCreateCustomLineCap Lib "gdiplus" ALIAS "GdipCreateCustomLineCap" (ByVal fillPath As Long, ByVal strokePath As Long, ByVal baseCap As LineCap, ByVal baseInset As Single, customCap As Long) AS LONG 
'declare function GdipDeleteCustomLineCap Lib "gdiplus" ALIAS "GdipDeleteCustomLineCap" (ByVal customCap As Long) AS LONG 
'declare function GdipCloneCustomLineCap Lib "gdiplus" ALIAS "GdipCloneCustomLineCap" (ByVal customCap As Long, clonedCap As Long) AS LONG 
'declare function GdipGetCustomLineCapType Lib "gdiplus" ALIAS "GdipGetCustomLineCapType" (ByVal customCap As Long, capType As CustomLineCapType) AS LONG 
'declare function GdipSetCustomLineCapStrokeCaps Lib "gdiplus" ALIAS "GdipSetCustomLineCapStrokeCaps" (ByVal customCap As Long, ByVal startCap As LineCap, ByVal endCap As LineCap) AS LONG 
'declare function GdipGetCustomLineCapStrokeCaps Lib "gdiplus" ALIAS "GdipGetCustomLineCapStrokeCaps" (ByVal customCap As Long, startCap As LineCap, endCap As LineCap) AS LONG 
'declare function GdipSetCustomLineCapStrokeJoin Lib "gdiplus" ALIAS "GdipSetCustomLineCapStrokeJoin" (ByVal customCap As Long, ByVal LnJoin As LineJoin) AS LONG 
'declare function GdipGetCustomLineCapStrokeJoin Lib "gdiplus" ALIAS "GdipGetCustomLineCapStrokeJoin" (ByVal customCap As Long, LnJoin As LineJoin) AS LONG 
'declare function GdipSetCustomLineCapBaseCap Lib "gdiplus" ALIAS "GdipSetCustomLineCapBaseCap" (ByVal customCap As Long, ByVal baseCap As LineCap) AS LONG 
'declare function GdipGetCustomLineCapBaseCap Lib "gdiplus" ALIAS "GdipGetCustomLineCapBaseCap" (ByVal customCap As Long, baseCap As LineCap) AS LONG 
'declare function GdipSetCustomLineCapBaseInset Lib "gdiplus" ALIAS "GdipSetCustomLineCapBaseInset" (ByVal customCap As Long, ByVal inset As Single) AS LONG 
'declare function GdipGetCustomLineCapBaseInset Lib "gdiplus" ALIAS "GdipGetCustomLineCapBaseInset" (ByVal customCap As Long, inset As Single) AS LONG 
'declare function GdipSetCustomLineCapWidthScale Lib "gdiplus" ALIAS "GdipSetCustomLineCapWidthScale" (ByVal customCap As Long, ByVal widthScale As Single) AS LONG 
'declare function GdipGetCustomLineCapWidthScale Lib "gdiplus" ALIAS "GdipGetCustomLineCapWidthScale" (ByVal customCap As Long, widthScale As Single) AS LONG 
'
'' AdjustableArrowCap Functions (ALL) ALIAS "Functions" 
'declare function GdipCreateAdjustableArrowCap Lib "gdiplus" ALIAS "GdipCreateAdjustableArrowCap" (ByVal Height As Single, ByVal Width As Single, ByVal isFilled As Long, cap As Long) AS LONG 
'declare function GdipSetAdjustableArrowCapHeight Lib "gdiplus" ALIAS "GdipSetAdjustableArrowCapHeight" (ByVal cap As Long, ByVal Height As Single) AS LONG 
'declare function GdipGetAdjustableArrowCapHeight Lib "gdiplus" ALIAS "GdipGetAdjustableArrowCapHeight" (ByVal cap As Long, Height As Single) AS LONG 
'declare function GdipSetAdjustableArrowCapWidth Lib "gdiplus" ALIAS "GdipSetAdjustableArrowCapWidth" (ByVal cap As Long, ByVal Width As Single) AS LONG 
'declare function GdipGetAdjustableArrowCapWidth Lib "gdiplus" ALIAS "GdipGetAdjustableArrowCapWidth" (ByVal cap As Long, Width As Single) AS LONG 
'declare function GdipSetAdjustableArrowCapMiddleInset Lib "gdiplus" ALIAS "GdipSetAdjustableArrowCapMiddleInset" (ByVal cap As Long, ByVal middleInset As Single) AS LONG 
'declare function GdipGetAdjustableArrowCapMiddleInset Lib "gdiplus" ALIAS "GdipGetAdjustableArrowCapMiddleInset" (ByVal cap As Long, middleInset As Single) AS LONG 
'declare function GdipSetAdjustableArrowCapFillState Lib "gdiplus" ALIAS "GdipSetAdjustableArrowCapFillState" (ByVal cap As Long, ByVal bFillState As Long) AS LONG 
'declare function GdipGetAdjustableArrowCapFillState Lib "gdiplus" ALIAS "GdipGetAdjustableArrowCapFillState" (ByVal cap As Long, bFillState As Long) AS LONG 

' Bitmap Functions (ALL) ALIAS "Functions" 
declare function GdipCreateBitmapFromFile Lib "gdiplus" ALIAS "GdipCreateBitmapFromFile" (ByVal filename As Long, bitmap As Long) AS LONG 
declare function GdipCreateBitmapFromFileICM Lib "gdiplus" ALIAS "GdipCreateBitmapFromFileICM" (ByVal filename As Long, bitmap As Long) AS LONG 
' TODO: Uncomment if you ALIAS "Uncomment" have the IStream object declared, or equivalent 
Declare Function GdipCreateBitmapFromStream Lib "gdiplus" ALIAS "GdipCreateBitmapFromStream" (Byval stream As long, bitmap As Long) AS LONG 
Declare Function GdipCreateBitmapFromStreamICM Lib "gdiplus" ALIAS "GdipCreateBitmapFromStreamICM" (Byval stream As long, bitmap As Long) AS LONG 
' NOTE: The scan0 parameter ALIAS "The" is treated as a byte array 
declare function GdipCreateBitmapFromScan0 Lib "gdiplus" ALIAS "GdipCreateBitmapFromScan0" (ByVal Width As Long, ByVal Height As Long, ByVal stride As Long, ByVal PixelFormat As Long, scan0 As long, bitmap As Long) AS LONG 
declare function GdipCreateBitmapFromGraphics Lib "gdiplus" ALIAS "GdipCreateBitmapFromGraphics" (ByVal Width As Long, ByVal Height As Long, ByVal graphics As Long, bitmap As Long) AS LONG 
' TODO: Uncomment if DirectX ALIAS "Uncomment" is in your program 
'Declare Function GdipCreateBitmapFromDirectDrawSurface Lib "gdiplus" ALIAS "GdipCreateBitmapFromDirectDrawSurface" (surface As DirectDrawSurface7, bitmap As Long) AS LONG 
declare function GdipCreateBitmapFromGdiDib Lib "gdiplus" ALIAS "GdipCreateBitmapFromGdiDib" (lpBITMAPINFO As long, ByVal gdiBitmapData As Long, bitmap As Long) AS LONG 
declare function GdipCreateBitmapFromHBITMAP Lib "gdiplus" ALIAS "GdipCreateBitmapFromHBITMAP" (ByVal hbm As Long, ByVal hpal As Long, bitmap As Long) AS LONG 
declare function GdipCreateHBITMAPFromBitmap Lib "gdiplus" ALIAS "GdipCreateHBITMAPFromBitmap" (ByVal bitmap As Long, hbmReturn As Long, ByVal background As Long) AS LONG 
declare function GdipCreateBitmapFromHICON Lib "gdiplus" ALIAS "GdipCreateBitmapFromHICON" (ByVal hicon As Long, bitmap As Long) AS LONG 
declare function GdipCreateHICONFromBitmap Lib "gdiplus" ALIAS "GdipCreateHICONFromBitmap" (ByVal bitmap As Long, hbmReturn As Long) AS LONG 
declare function GdipCreateBitmapFromResource Lib "gdiplus" ALIAS "GdipCreateBitmapFromResource" (ByVal hInstance As Long, ByVal lpBitmapName As String, bitmap As Long) AS LONG 
declare function GdipCloneBitmapArea Lib "gdiplus" ALIAS "GdipCloneBitmapArea" (ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal PixelFormat As Long, ByVal srcBitmap As Long, dstBitmap As Long) AS LONG
declare function GdipCloneBitmapAreaI Lib "gdiplus" ALIAS "GdipCloneBitmapAreaI" (ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, ByVal PixelFormat As Long, ByVal srcBitmap As Long, dstBitmap As Long) AS LONG
declare function GdipBitmapLockBits Lib "gdiplus" ALIAS "GdipBitmapLockBits" (ByVal bitmap As Long, rect As long, ByVal flags As long, ByVal PixelFormat As Long, lockedBitmapData As long) AS LONG 
declare function GdipBitmapUnlockBits Lib "gdiplus" ALIAS "GdipBitmapUnlockBits" (ByVal bitmap As Long, lockedBitmapData As long) AS LONG 
declare function GdipBitmapGetPixel Lib "gdiplus" ALIAS "GdipBitmapGetPixel" (ByVal bitmap As Long, ByVal x As Long, ByVal y As Long, color As Long) AS LONG 
declare function GdipBitmapSetPixel Lib "gdiplus" ALIAS "GdipBitmapSetPixel" (ByVal bitmap As Long, ByVal x As Long, ByVal y As Long, ByVal color As Long) AS LONG 
declare function GdipBitmapSetResolution Lib "gdiplus" ALIAS "GdipBitmapSetResolution" (ByVal bitmap As Long, ByVal xdpi As Single, ByVal ydpi As Single) AS LONG 

' CachedBitmap Functions (ALL) ALIAS "Functions" 
declare function GdipCreateCachedBitmap Lib "gdiplus" ALIAS "GdipCreateCachedBitmap" (ByVal bitmap As Long, ByVal graphics As Long, cachedBitmap As Long) AS LONG 
declare function GdipDeleteCachedBitmap Lib "gdiplus" ALIAS "GdipDeleteCachedBitmap" (ByVal cachedBitmap As Long) AS LONG 
declare function GdipDrawCachedBitmap Lib "gdiplus" ALIAS "GdipDrawCachedBitmap" (ByVal graphics As Long, ByVal cachedBitmap As Long, ByVal x As Long, ByVal y As Long) AS LONG 

' Brush Functions (ALL) ALIAS "Functions" 
declare function GdipCloneBrush Lib "gdiplus" ALIAS "GdipCloneBrush" (ByVal brush As Long, cloneBrush As Long) AS LONG 
declare function GdipDeleteBrush Lib "gdiplus" ALIAS "GdipDeleteBrush" (ByVal brush As Long) AS LONG 
declare function GdipGetBrushType Lib "gdiplus" ALIAS "GdipGetBrushType" (ByVal brush As Long, brshType As long) AS LONG 

' HatchBrush Functions (ALL) ALIAS "Functions" 
declare function GdipCreateHatchBrush Lib "gdiplus" ALIAS "GdipCreateHatchBrush" (ByVal style As long, ByVal forecolr As Long, ByVal backcolr As Long, brush As Long) AS LONG 
declare function GdipGetHatchStyle Lib "gdiplus" ALIAS "GdipGetHatchStyle" (ByVal brush As Long, style As long) AS LONG 
declare function GdipGetHatchForegroundColor Lib "gdiplus" ALIAS "GdipGetHatchForegroundColor" (ByVal brush As Long, forecolr As Long) AS LONG 
declare function GdipGetHatchBackgroundColor Lib "gdiplus" ALIAS "GdipGetHatchBackgroundColor" (ByVal brush As Long, backcolr As Long) AS LONG 

' SolidBrush Functions (ALL) ALIAS "Functions" 
declare function GdipCreateSolidFill Lib "gdiplus" ALIAS "GdipCreateSolidFill" (ByVal argb As Long, brush As Long) AS LONG 
declare function GdipSetSolidFillColor Lib "gdiplus" ALIAS "GdipSetSolidFillColor" (ByVal brush As Long, ByVal argb As Long) AS LONG 
declare function GdipGetSolidFillColor Lib "gdiplus" ALIAS "GdipGetSolidFillColor" (ByVal brush As Long, argb As Long) AS LONG 

' LineBrush Functions (ALL) ALIAS "Functions" 
declare function GdipCreateLineBrush Lib "gdiplus" ALIAS "GdipCreateLineBrush" (point1 As long, point2 As long, ByVal color1 As Long, ByVal color2 As Long, ByVal WrapMd As long, lineGradient As Long) AS LONG 
declare function GdipCreateLineBrushI Lib "gdiplus" ALIAS "GdipCreateLineBrushI" (point1 As long, point2 As long, ByVal color1 As Long, ByVal color2 As Long, ByVal WrapMd As long, lineGradient As Long) AS LONG 
declare function GdipCreateLineBrushFromRect Lib "gdiplus" ALIAS "GdipCreateLineBrushFromRect" (rect As long, ByVal color1 As Long, ByVal color2 As Long, ByVal mode As long, ByVal WrapMd As long, lineGradient As Long) AS LONG 
declare function GdipCreateLineBrushFromRectI Lib "gdiplus" ALIAS "GdipCreateLineBrushFromRectI" (rect As long, ByVal color1 As Long, ByVal color2 As Long, ByVal mode As long, ByVal WrapMd As long, lineGradient As Long) AS LONG 
declare function GdipCreateLineBrushFromRectWithAngle Lib "gdiplus" ALIAS "GdipCreateLineBrushFromRectWithAngle" (rect As long, ByVal color1 As Long, ByVal color2 As Long, ByVal angle As Single, ByVal isAngleScalable As Long, ByVal WrapMd As long, lineGradient As Long) AS LONG
declare function GdipCreateLineBrushFromRectWithAngleI Lib "gdiplus" ALIAS "GdipCreateLineBrushFromRectWithAngleI" (rect As long, ByVal color1 As Long, ByVal color2 As Long, ByVal angle As Single, ByVal isAngleScalable As Long, ByVal WrapMd As long, lineGradient As Long) AS LONG
declare function GdipSetLineColors Lib "gdiplus" ALIAS "GdipSetLineColors" (ByVal brush As Long, ByVal color1 As Long, ByVal color2 As Long) AS LONG 
declare function GdipGetLineColors Lib "gdiplus" ALIAS "GdipGetLineColors" (ByVal brush As Long, lColors As Long) AS LONG 
declare function GdipGetLineRect Lib "gdiplus" ALIAS "GdipGetLineRect" (ByVal brush As Long, rect As long) AS LONG 
declare function GdipGetLineRectI Lib "gdiplus" ALIAS "GdipGetLineRectI" (ByVal brush As Long, rect As long) AS LONG 
declare function GdipSetLineGammaCorrection Lib "gdiplus" ALIAS "GdipSetLineGammaCorrection" (ByVal brush As Long, ByVal useGammaCorrection As Long) AS LONG 
declare function GdipGetLineGammaCorrection Lib "gdiplus" ALIAS "GdipGetLineGammaCorrection" (ByVal brush As Long, useGammaCorrection As Long) AS LONG 
declare function GdipGetLineBlendCount Lib "gdiplus" ALIAS "GdipGetLineBlendCount" (ByVal brush As Long, count As Long) AS LONG 
declare function GdipGetLineBlend Lib "gdiplus" ALIAS "GdipGetLineBlend" (ByVal brush As Long, blend As Single, positions As Single, ByVal count As Long) AS LONG 
declare function GdipSetLineBlend Lib "gdiplus" ALIAS "GdipSetLineBlend" (ByVal brush As Long, blend As Single, positions As Single, ByVal count As Long) AS LONG 
declare function GdipGetLinePresetBlendCount Lib "gdiplus" ALIAS "GdipGetLinePresetBlendCount" (ByVal brush As Long, count As Long) AS LONG 
declare function GdipGetLinePresetBlend Lib "gdiplus" ALIAS "GdipGetLinePresetBlend" (ByVal brush As Long, blend As Long, positions As Single, ByVal count As Long) AS LONG 
declare function GdipSetLinePresetBlend Lib "gdiplus" ALIAS "GdipSetLinePresetBlend" (ByVal brush As Long, blend As Long, positions As Single, ByVal count As Long) AS LONG 
declare function GdipSetLineSigmaBlend Lib "gdiplus" ALIAS "GdipSetLineSigmaBlend" (ByVal brush As Long, ByVal focus As Single, ByVal theScale As Single) AS LONG 
declare function GdipSetLineLinearBlend Lib "gdiplus" ALIAS "GdipSetLineLinearBlend" (ByVal brush As Long, ByVal focus As Single, ByVal theScale As Single) AS LONG 
declare function GdipSetLineWrapMode Lib "gdiplus" ALIAS "GdipSetLineWrapMode" (ByVal brush As Long, ByVal WrapMd As long) AS LONG 
declare function GdipGetLineWrapMode Lib "gdiplus" ALIAS "GdipGetLineWrapMode" (ByVal brush As Long, WrapMd As long) AS LONG 
declare function GdipGetLineTransform Lib "gdiplus" ALIAS "GdipGetLineTransform" (ByVal brush As Long, matrix As Long) AS LONG 
declare function GdipSetLineTransform Lib "gdiplus" ALIAS "GdipSetLineTransform" (ByVal brush As Long, ByVal matrix As Long) AS LONG 
declare function GdipResetLineTransform Lib "gdiplus" ALIAS "GdipResetLineTransform" (ByVal brush As Long) AS LONG 
declare function GdipMultiplyLineTransform Lib "gdiplus" ALIAS "GdipMultiplyLineTransform" (ByVal brush As Long, ByVal matrix As Long, ByVal order As long) AS LONG 
declare function GdipTranslateLineTransform Lib "gdiplus" ALIAS "GdipTranslateLineTransform" (ByVal brush As Long, ByVal dx As Single, ByVal dy As Single, ByVal order As long) AS LONG 
declare function GdipScaleLineTransform Lib "gdiplus" ALIAS "GdipScaleLineTransform" (ByVal brush As Long, ByVal sx As Single, ByVal sy As Single, ByVal order As long) AS LONG 
declare function GdipRotateLineTransform Lib "gdiplus" ALIAS "GdipRotateLineTransform" (ByVal brush As Long, ByVal angle As Single, ByVal order As long) AS LONG 

' TextureBrush Functions (ALL) ALIAS "Functions" 
declare function GdipCreateTexture Lib "gdiplus" ALIAS "GdipCreateTexture" (ByVal image As Long, ByVal WrapMd As long, texture As Long) AS LONG 
declare function GdipCreateTexture2 Lib "gdiplus" ALIAS "GdipCreateTexture2" (ByVal image As Long, ByVal WrapMd As long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, texture As Long) AS LONG
declare function GdipCreateTextureIA Lib "gdiplus" ALIAS "GdipCreateTextureIA" (ByVal image As Long, ByVal imageAttributes As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, texture As Long) AS LONG
declare function GdipCreateTexture2I Lib "gdiplus" ALIAS "GdipCreateTexture2I" (ByVal image As Long, ByVal WrapMd As long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, texture As Long) AS LONG
declare function GdipCreateTextureIAI Lib "gdiplus" ALIAS "GdipCreateTextureIAI" (ByVal image As Long, ByVal imageAttributes As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, texture As Long) AS Long
declare function GdipGetTextureTransform Lib "gdiplus" ALIAS "GdipGetTextureTransform" (ByVal brush As Long, ByVal matrix As Long) AS LONG 
declare function GdipSetTextureTransform Lib "gdiplus" ALIAS "GdipSetTextureTransform" (ByVal brush As Long, ByVal matrix As Long) AS LONG 
declare function GdipResetTextureTransform Lib "gdiplus" ALIAS "GdipResetTextureTransform" (ByVal brush As Long) AS LONG 
declare function GdipTranslateTextureTransform Lib "gdiplus" ALIAS "GdipTranslateTextureTransform" (ByVal brush As Long, ByVal dx As Single, ByVal dy As Single, ByVal order As long) AS LONG 
declare function GdipMultiplyTextureTransform Lib "gdiplus" ALIAS "GdipMultiplyTextureTransform" (ByVal brush As Long, ByVal matrix As Long, ByVal order As long) AS LONG 
declare function GdipScaleTextureTransform Lib "gdiplus" ALIAS "GdipScaleTextureTransform" (ByVal brush As Long, ByVal sx As Single, ByVal sy As Single, ByVal order As long) AS LONG 
declare function GdipRotateTextureTransform Lib "gdiplus" ALIAS "GdipRotateTextureTransform" (ByVal brush As Long, ByVal angle As Single, ByVal order As long) AS LONG 
declare function GdipSetTextureWrapMode Lib "gdiplus" ALIAS "GdipSetTextureWrapMode" (ByVal brush As Long, ByVal WrapMd As long) AS LONG 
declare function GdipGetTextureWrapMode Lib "gdiplus" ALIAS "GdipGetTextureWrapMode" (ByVal brush As Long, WrapMd As long) AS LONG 
declare function GdipGetTextureImage Lib "gdiplus" ALIAS "GdipGetTextureImage" (ByVal brush As Long, image As Long) AS LONG 

' PathGradientBrush Functions (ALL) ALIAS "Functions" 
declare function GdipCreatePathGradient Lib "gdiplus" ALIAS "GdipCreatePathGradient" (Points As long, ByVal count As Long, ByVal WrapMd As long, polyGradient As Long) AS LONG 
declare function GdipCreatePathGradientI Lib "gdiplus" ALIAS "GdipCreatePathGradientI" (Points As long, ByVal count As Long, ByVal WrapMd As long, polyGradient As Long) AS LONG 
declare function GdipCreatePathGradientFromPath Lib "gdiplus" ALIAS "GdipCreatePathGradientFromPath" (ByVal path As Long, polyGradient As Long) AS LONG 
declare function GdipGetPathGradientCenterColor Lib "gdiplus" ALIAS "GdipGetPathGradientCenterColor" (ByVal brush As Long, lColors As Long) AS LONG 
declare function GdipSetPathGradientCenterColor Lib "gdiplus" ALIAS "GdipSetPathGradientCenterColor" (ByVal brush As Long, ByVal lColors As Long) AS LONG 
declare function GdipGetPathGradientSurroundColorsWithCount Lib "gdiplus" ALIAS "GdipGetPathGradientSurroundColorsWithCount" (ByVal brush As Long, argb As Long, count As Long) AS LONG 
declare function GdipSetPathGradientSurroundColorsWithCount Lib "gdiplus" ALIAS "GdipSetPathGradientSurroundColorsWithCount" (ByVal brush As Long, argb As Long, count As Long) AS LONG 
declare function GdipGetPathGradientPath Lib "gdiplus" ALIAS "GdipGetPathGradientPath" (ByVal brush As Long, ByVal path As Long) AS LONG 
declare function GdipSetPathGradientPath Lib "gdiplus" ALIAS "GdipSetPathGradientPath" (ByVal brush As Long, ByVal path As Long) AS LONG 
declare function GdipGetPathGradientCenterPoint Lib "gdiplus" ALIAS "GdipGetPathGradientCenterPoint" (ByVal brush As Long, Points As long) AS LONG 
declare function GdipGetPathGradientCenterPointI Lib "gdiplus" ALIAS "GdipGetPathGradientCenterPointI" (ByVal brush As Long, Points As long) AS LONG 
declare function GdipSetPathGradientCenterPoint Lib "gdiplus" ALIAS "GdipSetPathGradientCenterPoint" (ByVal brush As Long, Points As long) AS LONG 
declare function GdipSetPathGradientCenterPointI Lib "gdiplus" ALIAS "GdipSetPathGradientCenterPointI" (ByVal brush As Long, Points As long) AS LONG 
declare function GdipGetPathGradientRect Lib "gdiplus" ALIAS "GdipGetPathGradientRect" (ByVal brush As Long, rect As long) AS LONG 
declare function GdipGetPathGradientRectI Lib "gdiplus" ALIAS "GdipGetPathGradientRectI" (ByVal brush As Long, rect As long) AS LONG 
declare function GdipGetPathGradientPointCount Lib "gdiplus" ALIAS "GdipGetPathGradientPointCount" (ByVal brush As Long, count As Long) AS LONG 
declare function GdipGetPathGradientSurroundColorCount Lib "gdiplus" ALIAS "GdipGetPathGradientSurroundColorCount" (ByVal brush As Long, count As Long) AS LONG 
declare function GdipSetPathGradientGammaCorrection Lib "gdiplus" ALIAS "GdipSetPathGradientGammaCorrection" (ByVal brush As Long, ByVal useGammaCorrection As Long) AS LONG 
declare function GdipGetPathGradientGammaCorrection Lib "gdiplus" ALIAS "GdipGetPathGradientGammaCorrection" (ByVal brush As Long, useGammaCorrection As Long) AS LONG 
declare function GdipGetPathGradientBlendCount Lib "gdiplus" ALIAS "GdipGetPathGradientBlendCount" (ByVal brush As Long, count As Long) AS LONG 
declare function GdipGetPathGradientBlend Lib "gdiplus" ALIAS "GdipGetPathGradientBlend" (ByVal brush As Long, blend As Single, positions As Single, ByVal count As Long) AS LONG 
declare function GdipSetPathGradientBlend Lib "gdiplus" ALIAS "GdipSetPathGradientBlend" (ByVal brush As Long, blend As Single, positions As Single, ByVal count As Long) AS LONG 
declare function GdipGetPathGradientPresetBlendCount Lib "gdiplus" ALIAS "GdipGetPathGradientPresetBlendCount" (ByVal brush As Long, count As Long) AS LONG 
declare function GdipGetPathGradientPresetBlend Lib "gdiplus" ALIAS "GdipGetPathGradientPresetBlend" (ByVal brush As Long, blend As Long, positions As Single, ByVal count As Long) AS LONG 
declare function GdipSetPathGradientPresetBlend Lib "gdiplus" ALIAS "GdipSetPathGradientPresetBlend" (ByVal brush As Long, blend As Long, positions As Single, ByVal count As Long) AS LONG 
declare function GdipSetPathGradientSigmaBlend Lib "gdiplus" ALIAS "GdipSetPathGradientSigmaBlend" (ByVal brush As Long, ByVal focus As Single, ByVal sscale As Single) AS LONG 
declare function GdipSetPathGradientLinearBlend Lib "gdiplus" ALIAS "GdipSetPathGradientLinearBlend" (ByVal brush As Long, ByVal focus As Single, ByVal sscale As Single) AS LONG 
declare function GdipGetPathGradientWrapMode Lib "gdiplus" ALIAS "GdipGetPathGradientWrapMode" (ByVal brush As Long, WrapMd As long) AS LONG 
declare function GdipSetPathGradientWrapMode Lib "gdiplus" ALIAS "GdipSetPathGradientWrapMode" (ByVal brush As Long, ByVal WrapMd As long) AS LONG 
declare function GdipGetPathGradientTransform Lib "gdiplus" ALIAS "GdipGetPathGradientTransform" (ByVal brush As Long, ByVal matrix As Long) AS LONG 
declare function GdipSetPathGradientTransform Lib "gdiplus" ALIAS "GdipSetPathGradientTransform" (ByVal brush As Long, ByVal matrix As Long) AS LONG 
declare function GdipResetPathGradientTransform Lib "gdiplus" ALIAS "GdipResetPathGradientTransform" (ByVal brush As Long) AS LONG 
declare function GdipMultiplyPathGradientTransform Lib "gdiplus" ALIAS "GdipMultiplyPathGradientTransform" (ByVal brush As Long, ByVal matrix As Long, ByVal order As long) AS LONG 
declare function GdipTranslatePathGradientTransform Lib "gdiplus" ALIAS "GdipTranslatePathGradientTransform" (ByVal brush As Long, ByVal dx As Single, ByVal dy As Single, ByVal order As long) AS LONG 
declare function GdipScalePathGradientTransform Lib "gdiplus" ALIAS "GdipScalePathGradientTransform" (ByVal brush As Long, ByVal sx As Single, ByVal sy As Single, ByVal order As long) AS LONG 
declare function GdipRotatePathGradientTransform Lib "gdiplus" ALIAS "GdipRotatePathGradientTransform" (ByVal brush As Long, ByVal angle As Single, ByVal order As long) AS LONG 
declare function GdipGetPathGradientFocusScales Lib "gdiplus" ALIAS "GdipGetPathGradientFocusScales" (ByVal brush As Long, xScale As Single, yScale As Single) AS LONG 
declare function GdipSetPathGradientFocusScales Lib "gdiplus" ALIAS "GdipSetPathGradientFocusScales" (ByVal brush As Long, ByVal xScale As Single, ByVal yScale As Single) AS LONG 

' GraphicsPath Functions (ALL) ALIAS "Functions" 
'declare function GdipCreatePath Lib "gdiplus" ALIAS "GdipCreatePath" (ByVal brushmode As FillMode, path As Long) AS LONG 
'' NOTE: The types parameter ALIAS "The" is treated as a byte array 
'declare function GdipCreatePath2 Lib "gdiplus" ALIAS "GdipCreatePath2" (Points As long, types As long, ByVal count As Long, brushmode As FillMode, path As Long) AS LONG 
'declare function GdipCreatePath2I Lib "gdiplus" ALIAS "GdipCreatePath2I" (Points As long, types As long, ByVal count As Long, brushmode As FillMode, path As Long) AS LONG 
'declare function GdipClonePath Lib "gdiplus" ALIAS "GdipClonePath" (ByVal path As Long, clonePath As Long) AS LONG 
'declare function GdipDeletePath Lib "gdiplus" ALIAS "GdipDeletePath" (ByVal path As Long) AS LONG 
'declare function GdipResetPath Lib "gdiplus" ALIAS "GdipResetPath" (ByVal path As Long) AS LONG 
'declare function GdipGetPointCount Lib "gdiplus" ALIAS "GdipGetPointCount" (ByVal path As Long, count As Long) AS LONG 
'' NOTE: The types parameter ALIAS "The" is treated as a byte array 
'declare function GdipGetPathTypes Lib "gdiplus" ALIAS "GdipGetPathTypes" (ByVal path As Long, types As long, ByVal count As Long) AS LONG 
'declare function GdipGetPathPoints Lib "gdiplus" ALIAS "GdipGetPathPoints" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipGetPathPointsI Lib "gdiplus" ALIAS "GdipGetPathPointsI" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipGetPathFillMode Lib "gdiplus" ALIAS "GdipGetPathFillMode" (ByVal path As Long, ByVal brushmode As FillMode) AS LONG 
'declare function GdipSetPathFillMode Lib "gdiplus" ALIAS "GdipSetPathFillMode" (ByVal path As Long, ByVal brushmode As FillMode) AS LONG 
'declare function GdipGetPathData Lib "gdiplus" ALIAS "GdipGetPathData" (ByVal path As Long, pdata As PathData) AS LONG 
'declare function GdipStartPathFigure Lib "gdiplus" ALIAS "GdipStartPathFigure" (ByVal path As Long) AS LONG 
'declare function GdipClosePathFigure Lib "gdiplus" ALIAS "GdipClosePathFigure" (ByVal path As Long) AS LONG 
'declare function GdipClosePathFigures Lib "gdiplus" ALIAS "GdipClosePathFigures" (ByVal path As Long) AS LONG 
'declare function GdipSetPathMarker Lib "gdiplus" ALIAS "GdipSetPathMarker" (ByVal path As Long) AS LONG 
'declare function GdipClearPathMarkers Lib "gdiplus" ALIAS "GdipClearPathMarkers" (ByVal path As Long) AS LONG 
'declare function GdipReversePath Lib "gdiplus" ALIAS "GdipReversePath" (ByVal path As Long) AS LONG 
'declare function GdipGetPathLastPoint Lib "gdiplus" ALIAS "GdipGetPathLastPoint" (ByVal path As Long, lastPoint As long) AS LONG 
'declare function GdipAddPathLine Lib "gdiplus" ALIAS "GdipAddPathLine" (ByVal path As Long, ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single) AS LONG 
'declare function GdipAddPathLine2 Lib "gdiplus" ALIAS "GdipAddPathLine2" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathArc Lib "gdiplus" ALIAS "GdipAddPathArc" (ByVal path As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal startAngle As Single, ByVal sweepAngle As Single)
'declare function GdipAddPathBezier Lib "gdiplus" ALIAS "GdipAddPathBezier" (ByVal path As Long, ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single, ByVal x3 As Single, ByVal y3 As Single,
'declare function GdipAddPathBeziers Lib "gdiplus" ALIAS "GdipAddPathBeziers" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathCurve Lib "gdiplus" ALIAS "GdipAddPathCurve" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathCurve2 Lib "gdiplus" ALIAS "GdipAddPathCurve2" (ByVal path As Long, Points As long, ByVal count As Long, ByVal tension As Single) AS LONG 
'declare function GdipAddPathCurve3 Lib "gdiplus" ALIAS "GdipAddPathCurve3" (ByVal path As Long, Points As long, ByVal count As Long, ByVal Offset As Long, ByVal numberOfSegments As Long, ByVal tension As Single) AS LONG 
'declare function GdipAddPathClosedCurve Lib "gdiplus" ALIAS "GdipAddPathClosedCurve" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathClosedCurve2 Lib "gdiplus" ALIAS "GdipAddPathClosedCurve2" (ByVal path As Long, Points As long, ByVal count As Long, ByVal tension As Single) AS LONG 
'declare function GdipAddPathRectangle Lib "gdiplus" ALIAS "GdipAddPathRectangle" (ByVal path As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) AS LONG 
'declare function GdipAddPathRectangles Lib "gdiplus" ALIAS "GdipAddPathRectangles" (ByVal path As Long, rect As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathEllipse Lib "gdiplus" ALIAS "GdipAddPathEllipse" (ByVal path As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single) AS LONG 
'declare function GdipAddPathPie Lib "gdiplus" ALIAS "GdipAddPathPie" (ByVal path As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal startAngle As Single, ByVal sweepAngle As Single)
'declare function GdipAddPathPolygon Lib "gdiplus" ALIAS "GdipAddPathPolygon" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathPath Lib "gdiplus" ALIAS "GdipAddPathPath" (ByVal path As Long, ByVal addingPath As Long, ByVal bConnect As Long) AS LONG 
'declare function GdipAddPathString Lib "gdiplus" ALIAS "GdipAddPathString" (ByVal path As Long, ByVal str As String, ByVal length As Long, ByVal family As Long, ByVal style As Long, ByVal emSize As Single, layoutRect As long, ByVal
'declare function GdipAddPathStringI Lib "gdiplus" ALIAS "GdipAddPathStringI" (ByVal path As Long, ByVal str As String, ByVal length As Long, ByVal family As Long, ByVal style As Long, ByVal emSize As Single, layoutRect As long, ByVal
'declare function GdipAddPathLineI Lib "gdiplus" ALIAS "GdipAddPathLineI" (ByVal path As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) AS LONG 
'declare function GdipAddPathLine2I Lib "gdiplus" ALIAS "GdipAddPathLine2I" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathArcI Lib "gdiplus" ALIAS "GdipAddPathArcI" (ByVal path As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, ByVal startAngle As Single, ByVal sweepAngle As Single)
'declare function GdipAddPathBezierI Lib "gdiplus" ALIAS "GdipAddPathBezierI" (ByVal path As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long, ByVal x3 As Long, ByVal y3 As Long,
'declare function GdipAddPathBeziersI Lib "gdiplus" ALIAS "GdipAddPathBeziersI" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathCurveI Lib "gdiplus" ALIAS "GdipAddPathCurveI" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathCurve2I Lib "gdiplus" ALIAS "GdipAddPathCurve2I" (ByVal path As Long, Points As long, ByVal count As Long, ByVal tension As Long) AS LONG 
'declare function GdipAddPathCurve3I Lib "gdiplus" ALIAS "GdipAddPathCurve3I" (ByVal path As Long, Points As long, ByVal count As Long, ByVal Offset As Long, ByVal numberOfSegments As Long, ByVal tension As Single) AS LONG 
'declare function GdipAddPathClosedCurveI Lib "gdiplus" ALIAS "GdipAddPathClosedCurveI" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathClosedCurve2I Lib "gdiplus" ALIAS "GdipAddPathClosedCurve2I" (ByVal path As Long, Points As long, ByVal count As Long, ByVal tension As Single) AS LONG 
'declare function GdipAddPathRectangleI Lib "gdiplus" ALIAS "GdipAddPathRectangleI" (ByVal path As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long) AS LONG 
'declare function GdipAddPathRectanglesI Lib "gdiplus" ALIAS "GdipAddPathRectanglesI" (ByVal path As Long, rects As long, ByVal count As Long) AS LONG 
'declare function GdipAddPathEllipseI Lib "gdiplus" ALIAS "GdipAddPathEllipseI" (ByVal path As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long) AS LONG 
'declare function GdipAddPathPieI Lib "gdiplus" ALIAS "GdipAddPathPieI" (ByVal path As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, ByVal startAngle As Single, ByVal sweepAngle As Single)
'declare function GdipAddPathPolygonI Lib "gdiplus" ALIAS "GdipAddPathPolygonI" (ByVal path As Long, Points As long, ByVal count As Long) AS LONG 
'declare function GdipFlattenPath Lib "gdiplus" ALIAS "GdipFlattenPath" (ByVal path As Long, Optional ByVal matrix As Long = 0, Optional ByVal flatness As Single = FlatnessDefault) AS LONG 
'declare function GdipWindingModeOutline Lib "gdiplus" ALIAS "GdipWindingModeOutline" (ByVal path As Long, ByVal matrix As Long, ByVal flatness As Single) AS LONG 
'declare function GdipWidenPath Lib "gdiplus" ALIAS "GdipWidenPath" (ByVal nativePath As Long, ByVal pen As Long, ByVal matrix As Long, ByVal flatness As Single) AS LONG 
'declare function GdipWarpPath Lib "gdiplus" ALIAS "GdipWarpPath" (ByVal path As Long, ByVal matrix As Long, Points As long, ByVal count As Long, ByVal srcx As Single, ByVal srcy As Single, ByVal srcwidth As Single, ByVal
'declare function GdipTransformPath Lib "gdiplus" ALIAS "GdipTransformPath" (ByVal path As Long, ByVal matrix As Long) AS LONG 
'declare function GdipGetPathWorldBounds Lib "gdiplus" ALIAS "GdipGetPathWorldBounds" (ByVal path As Long, bounds As long, ByVal matrix As Long, ByVal pen As Long) AS LONG 
'declare function GdipGetPathWorldBoundsI Lib "gdiplus" ALIAS "GdipGetPathWorldBoundsI" (ByVal path As Long, bounds As long, ByVal matrix As Long, ByVal pen As Long) AS LONG 
'declare function GdipIsVisiblePathPoint Lib "gdiplus" ALIAS "GdipIsVisiblePathPoint" (ByVal path As Long, ByVal x As Single, ByVal y As Single, ByVal graphics As Long, result As Long) AS LONG 
'declare function GdipIsVisiblePathPointI Lib "gdiplus" ALIAS "GdipIsVisiblePathPointI" (ByVal path As Long, ByVal x As Long, ByVal y As Long, ByVal graphics As Long, result As Long) AS LONG 
'declare function GdipIsOutlineVisiblePathPoint Lib "gdiplus" ALIAS "GdipIsOutlineVisiblePathPoint" (ByVal path As Long, ByVal x As Single, ByVal y As Single, ByVal pen As Long, ByVal graphics As Long, result As Long) AS LONG 
'declare function GdipIsOutlineVisiblePathPointI Lib "gdiplus" ALIAS "GdipIsOutlineVisiblePathPointI" (ByVal path As Long, ByVal x As Long, ByVal y As Long, ByVal pen As Long, ByVal graphics As Long, result As Long) AS LONG 

' PathIterator Functions (ALL) ALIAS "Functions" 
'declare function GdipCreatePathIter Lib "gdiplus" ALIAS "GdipCreatePathIter" (iterator As Long, ByVal path As Long) AS LONG 
'declare function GdipDeletePathIter Lib "gdiplus" ALIAS "GdipDeletePathIter" (ByVal iterator As Long) AS LONG 
'declare function GdipPathIterNextSubpath Lib "gdiplus" ALIAS "GdipPathIterNextSubpath" (ByVal iterator As Long, resultCount As Long, startIndex As Long, endIndex As Long, isClosed As Long) AS LONG 
'declare function GdipPathIterNextSubpathPath Lib "gdiplus" ALIAS "GdipPathIterNextSubpathPath" (ByVal iterator As Long, resultCount As Long, ByVal path As Long, isClosed As Long) AS LONG 
'declare function GdipPathIterNextPathType Lib "gdiplus" ALIAS "GdipPathIterNextPathType" (ByVal iterator As Long, resultCount As Long, pathType As long, startIndex As Long, endIndex As Long) AS LONG 
'declare function GdipPathIterNextMarker Lib "gdiplus" ALIAS "GdipPathIterNextMarker" (ByVal iterator As Long, resultCount As Long, startIndex As Long, endIndex As Long) AS LONG 
'declare function GdipPathIterNextMarkerPath Lib "gdiplus" ALIAS "GdipPathIterNextMarkerPath" (ByVal iterator As Long, resultCount As Long, ByVal path As Long) AS LONG 
'declare function GdipPathIterGetCount Lib "gdiplus" ALIAS "GdipPathIterGetCount" (ByVal iterator As Long, count As Long) AS LONG 
'declare function GdipPathIterGetSubpathCount Lib "gdiplus" ALIAS "GdipPathIterGetSubpathCount" (ByVal iterator As Long, count As Long) AS LONG 
'declare function GdipPathIterIsValid Lib "gdiplus" ALIAS "GdipPathIterIsValid" (ByVal iterator As Long, valid As Long) AS LONG 
'declare function GdipPathIterHasCurve Lib "gdiplus" ALIAS "GdipPathIterHasCurve" (ByVal iterator As Long, hasCurve As Long) AS LONG 
'declare function GdipPathIterRewind Lib "gdiplus" ALIAS "GdipPathIterRewind" (ByVal iterator As Long) AS LONG 
'' NOTE: The types parameter ALIAS "The" is treated as a byte array 
'declare function GdipPathIterEnumerate Lib "gdiplus" ALIAS "GdipPathIterEnumerate" (ByVal iterator As Long, resultCount As Long, Points As long, types As long, ByVal count As Long) AS LONG 
'declare function GdipPathIterCopyData Lib "gdiplus" ALIAS "GdipPathIterCopyData" (ByVal iterator As Long, resultCount As Long, Points As long, types As long, ByVal startIndex As Long, ByVal endIndex As Long) AS LONG 

' Matrix Functions (ALL) ALIAS "Functions" 
declare function GdipCreateMatrix Lib "gdiplus" ALIAS "GdipCreateMatrix" (matrix As Long) AS LONG 
declare function GdipCreateMatrix2 Lib "gdiplus" ALIAS "GdipCreateMatrix2" (ByVal m11 As Single, ByVal m12 As Single, ByVal m21 As Single, ByVal m22 As Single, ByVal dx As Single, ByVal dy As Single, matrix As Long) AS long
declare function GdipCreateMatrix3 Lib "gdiplus" ALIAS "GdipCreateMatrix3" (rect As long, dstplg As long, matrix As Long) AS LONG 
declare function GdipCreateMatrix3I Lib "gdiplus" ALIAS "GdipCreateMatrix3I" (rect As long, dstplg As long, matrix As Long) AS LONG 
declare function GdipCloneMatrix Lib "gdiplus" ALIAS "GdipCloneMatrix" (ByVal matrix As Long, cloneMatrix As Long) AS LONG 
declare function GdipDeleteMatrix Lib "gdiplus" ALIAS "GdipDeleteMatrix" (ByVal matrix As Long) AS LONG 
'declare function GdipSetMatrixElements Lib "gdiplus" ALIAS "GdipSetMatrixElements" (ByVal matrix As Long, ByVal m11 As Single, ByVal m12 As Single, ByVal m21 As Single, ByVal m22 As Single, ByVal dx As Single, ByVal dy As Single)
declare function GdipMultiplyMatrix Lib "gdiplus" ALIAS "GdipMultiplyMatrix" (ByVal matrix As Long, ByVal matrix2 As Long, ByVal order As long) AS LONG 
declare function GdipTranslateMatrix Lib "gdiplus" ALIAS "GdipTranslateMatrix" (ByVal matrix As Long, ByVal offsetX As Single, ByVal offsetY As Single, ByVal order As long) AS LONG 
declare function GdipScaleMatrix Lib "gdiplus" ALIAS "GdipScaleMatrix" (ByVal matrix As Long, ByVal scaleX As Single, ByVal scaleY As Single, ByVal order As long) AS LONG 
declare function GdipRotateMatrix Lib "gdiplus" ALIAS "GdipRotateMatrix" (ByVal matrix As Long, ByVal angle As Single, ByVal order As long) AS LONG 
declare function GdipShearMatrix Lib "gdiplus" ALIAS "GdipShearMatrix" (ByVal matrix As Long, ByVal shearX As Single, ByVal shearY As Single, ByVal order As long) AS LONG 
declare function GdipInvertMatrix Lib "gdiplus" ALIAS "GdipInvertMatrix" (ByVal matrix As Long) AS LONG 
declare function GdipTransformMatrixPoints Lib "gdiplus" ALIAS "GdipTransformMatrixPoints" (ByVal matrix As Long, pts As long, ByVal count As Long) AS LONG 
declare function GdipTransformMatrixPointsI Lib "gdiplus" ALIAS "GdipTransformMatrixPointsI" (ByVal matrix As Long, pts As long, ByVal count As Long) AS LONG 
declare function GdipVectorTransformMatrixPoints Lib "gdiplus" ALIAS "GdipVectorTransformMatrixPoints" (ByVal matrix As Long, pts As long, ByVal count As Long) AS LONG 
declare function GdipVectorTransformMatrixPointsI Lib "gdiplus" ALIAS "GdipVectorTransformMatrixPointsI" (ByVal matrix As Long, pts As long, ByVal count As Long) AS LONG 
declare function GdipGetMatrixElements Lib "gdiplus" ALIAS "GdipGetMatrixElements" (ByVal matrix As Long, matrixOut As Single) AS LONG 
declare function GdipIsMatrixInvertible Lib "gdiplus" ALIAS "GdipIsMatrixInvertible" (ByVal matrix As Long, result As Long) AS LONG 
declare function GdipIsMatrixIdentity Lib "gdiplus" ALIAS "GdipIsMatrixIdentity" (ByVal matrix As Long, result As Long) AS LONG 
declare function GdipIsMatrixEqual Lib "gdiplus" ALIAS "GdipIsMatrixEqual" (ByVal matrix As Long, ByVal matrix2 As Long, result As Long) AS LONG 

' Region Functions (ALL) ALIAS "Functions" 
declare function GdipCreateRegion Lib "gdiplus" ALIAS "GdipCreateRegion" (region As Long) AS LONG 
declare function GdipCreateRegionRect Lib "gdiplus" ALIAS "GdipCreateRegionRect" (rect As long, region As Long) AS LONG 
declare function GdipCreateRegionRectI Lib "gdiplus" ALIAS "GdipCreateRegionRectI" (rect As long, region As Long) AS LONG 
declare function GdipCreateRegionPath Lib "gdiplus" ALIAS "GdipCreateRegionPath" (ByVal path As Long, region As Long) AS LONG 
' NOTE: The regionData parameter ALIAS "The" is treated as a byte array 
declare function GdipCreateRegionRgnData Lib "gdiplus" ALIAS "GdipCreateRegionRgnData" (regionData As long, ByVal size As Long, region As Long) AS LONG 
declare function GdipCreateRegionHrgn Lib "gdiplus" ALIAS "GdipCreateRegionHrgn" (ByVal hRgn As Long, region As Long) AS LONG 
declare function GdipCloneRegion Lib "gdiplus" ALIAS "GdipCloneRegion" (ByVal region As Long, cloneRegion As Long) AS LONG 
declare function GdipDeleteRegion Lib "gdiplus" ALIAS "GdipDeleteRegion" (ByVal region As Long) AS LONG 
declare function GdipSetInfinite Lib "gdiplus" ALIAS "GdipSetInfinite" (ByVal region As Long) AS LONG 
declare function GdipSetEmpty Lib "gdiplus" ALIAS "GdipSetEmpty" (ByVal region As Long) AS LONG 
declare function GdipCombineRegionRect Lib "gdiplus" ALIAS "GdipCombineRegionRect" (ByVal region As Long, rect As long, ByVal CombineMd As long) AS LONG 
declare function GdipCombineRegionRectI Lib "gdiplus" ALIAS "GdipCombineRegionRectI" (ByVal region As Long, rect As long, ByVal CombineMd As long) AS LONG 
declare function GdipCombineRegionPath Lib "gdiplus" ALIAS "GdipCombineRegionPath" (ByVal region As Long, ByVal path As Long, ByVal CombineMd As long) AS LONG 
declare function GdipCombineRegionRegion Lib "gdiplus" ALIAS "GdipCombineRegionRegion" (ByVal region As Long, ByVal region2 As Long, ByVal CombineMd As long) AS LONG 
declare function GdipTranslateRegion Lib "gdiplus" ALIAS "GdipTranslateRegion" (ByVal region As Long, ByVal dx As Single, ByVal dy As Single) AS LONG 
declare function GdipTranslateRegionI Lib "gdiplus" ALIAS "GdipTranslateRegionI" (ByVal region As Long, ByVal dx As Long, ByVal dy As Long) AS LONG 
declare function GdipTransformRegion Lib "gdiplus" ALIAS "GdipTransformRegion" (ByVal region As Long, ByVal matrix As Long) AS LONG 
declare function GdipGetRegionBounds Lib "gdiplus" ALIAS "GdipGetRegionBounds" (ByVal region As Long, ByVal graphics As Long, rect As long) AS LONG 
declare function GdipGetRegionBoundsI Lib "gdiplus" ALIAS "GdipGetRegionBoundsI" (ByVal region As Long, ByVal graphics As Long, rect As long) AS LONG 
declare function GdipGetRegionHRgn Lib "gdiplus" ALIAS "GdipGetRegionHRgn" (ByVal region As Long, ByVal graphics As Long, hRgn As Long) AS LONG 
declare function GdipIsEmptyRegion Lib "gdiplus" ALIAS "GdipIsEmptyRegion" (ByVal region As Long, ByVal graphics As Long, result As Long) AS LONG 
declare function GdipIsInfiniteRegion Lib "gdiplus" ALIAS "GdipIsInfiniteRegion" (ByVal region As Long, ByVal graphics As Long, result As Long) AS LONG 
declare function GdipIsEqualRegion Lib "gdiplus" ALIAS "GdipIsEqualRegion" (ByVal region As Long, ByVal region2 As Long, ByVal graphics As Long, result As Long) AS LONG 
declare function GdipGetRegionDataSize Lib "gdiplus" ALIAS "GdipGetRegionDataSize" (ByVal region As Long, bufferSize As Long) AS LONG 
' NOTE: The buffer parameter ALIAS "The" is treated as a byte array 
declare function GdipGetRegionData Lib "gdiplus" ALIAS "GdipGetRegionData" (ByVal region As Long, buffer As long, ByVal bufferSize As Long, sizeFilled As Long) AS LONG 
declare function GdipIsVisibleRegionPoint Lib "gdiplus" ALIAS "GdipIsVisibleRegionPoint" (ByVal region As Long, ByVal x As Single, ByVal y As Single, ByVal graphics As Long, result As Long) AS LONG 
declare function GdipIsVisibleRegionPointI Lib "gdiplus" ALIAS "GdipIsVisibleRegionPointI" (ByVal region As Long, ByVal x As Long, ByVal y As Long, ByVal graphics As Long, result As Long) AS LONG 
declare function GdipIsVisibleRegionRect Lib "gdiplus" ALIAS "GdipIsVisibleRegionRect" (ByVal region As Long, ByVal x As Single, ByVal y As Single, ByVal Width As Single, ByVal Height As Single, ByVal graphics As Long, result As Long) AS LONG
declare function GdipIsVisibleRegionRectI Lib "gdiplus" ALIAS "GdipIsVisibleRegionRectI" (ByVal region As Long, ByVal x As Long, ByVal y As Long, ByVal Width As Long, ByVal Height As Long, ByVal graphics As Long, result As Long) AS LONG
declare function GdipGetRegionScansCount Lib "gdiplus" ALIAS "GdipGetRegionScansCount" (ByVal region As Long, Ucount As Long, ByVal matrix As Long) AS LONG 
declare function GdipGetRegionScans Lib "gdiplus" ALIAS "GdipGetRegionScans" (ByVal region As Long, rects As long, count As Long, ByVal matrix As Long) AS LONG 
declare function GdipGetRegionScansI Lib "gdiplus" ALIAS "GdipGetRegionScansI" (ByVal region As Long, rects As long, count As Long, ByVal matrix As Long) AS LONG 

' ImageAttributes APIs (ALL) ALIAS "APIs" 
declare function GdipCreateImageAttributes Lib "gdiplus" ALIAS "GdipCreateImageAttributes" (imageattr As Long) AS LONG 
declare function GdipCloneImageAttributes Lib "gdiplus" ALIAS "GdipCloneImageAttributes" (ByVal imageattr As Long, cloneImageattr As Long) AS LONG 
declare function GdipDisposeImageAttributes Lib "gdiplus" ALIAS "GdipDisposeImageAttributes" (ByVal imageattr As Long) AS LONG 
declare function GdipSetImageAttributesToIdentity Lib "gdiplus" ALIAS "GdipSetImageAttributesToIdentity" (ByVal imageattr As Long, ByVal ClrAdjType As long) AS LONG 
declare function GdipResetImageAttributes Lib "gdiplus" ALIAS "GdipResetImageAttributes" (ByVal imageattr As Long, ByVal ClrAdjType As long) AS LONG 
' NOTE: The colourMatrix and ALIAS "The" grayMatrix parameters expect a ColorMatrix structure or NULL 
'declare function GdipSetImageAttributesColorMatrix Lib "gdiplus" ALIAS "GdipSetImageAttributesColorMatrix" (ByVal imageattr As Long, ByVal ClrAdjType As long, ByVal enableFlag As Long, colourMatrixAs long, grayMatrix As long, ByVal flagsAs longFlags) AS LONG 
declare function GdipSetImageAttributesThreshold Lib "gdiplus" ALIAS "GdipSetImageAttributesThreshold" (ByVal imageattr As Long, ByVal ClrAdjType As long, ByVal enableFlag As Long, ByVal threshold As Single) AS LONG 
declare function GdipSetImageAttributesGamma Lib "gdiplus" ALIAS "GdipSetImageAttributesGamma" (ByVal imageattr As Long, ByVal ClrAdjType As long, ByVal enableFlag As Long, ByVal gamma As Single) AS LONG 
declare function GdipSetImageAttributesNoOp Lib "gdiplus" ALIAS "GdipSetImageAttributesNoOp" (ByVal imageattr As Long, ByVal ClrAdjType As long, ByVal enableFlag As Long) AS LONG 
declare function GdipSetImageAttributesColorKeys Lib "gdiplus" ALIAS "GdipSetImageAttributesColorKeys" (ByVal imageattr As Long, ByVal ClrAdjType As long, ByVal enableFlag As Long, ByVal colorLow As Long, ByVal colorHigh As Long) AS LONG 
'declare function GdipSetImageAttributesOutputChannel Lib "gdiplus" ALIAS "GdipSetImageAttributesOutputChannel" (ByVal imageattr As Long, ByVal ClrAdjstType As long, ByVal enableFlag As Long, ByVal channelFlags As ColorChannelFlags) AS LONG 
'declare function GdipSetImageAttributesOutputChannelColorProfile Lib "gdiplus" ALIAS "GdipSetImageAttributesOutputChannelColorProfile" (ByVal imageattr As Long, ByVal ClrAdjType As long, ByVal enableFlag As Long, ByVal colorProfileFilename As String) AS LONG 
declare function GdipSetImageAttributesRemapTable Lib "gdiplus" ALIAS "GdipSetImageAttributesRemapTable" (ByVal imageattr As Long, ByVal ClrAdjType As long, ByVal enableFlag As Long, ByVal mapSize As Long, map As long) AS LONG 
declare function GdipSetImageAttributesWrapMode Lib "gdiplus" ALIAS "GdipSetImageAttributesWrapMode" (ByVal imageattr As Long, ByVal wrap As long, ByVal argb As Long, ByVal bClamp As Long) AS LONG 
declare function GdipSetImageAttributesICMMode Lib "gdiplus" ALIAS "GdipSetImageAttributesICMMode" (ByVal imageattr As Long, ByVal bOn As Long) AS LONG 
declare function GdipGetImageAttributesAdjustedPalette Lib "gdiplus" ALIAS "GdipGetImageAttributesAdjustedPalette" (ByVal imageattr As Long, colorPal As long, ByVal ClrAdjType As long) AS LONG 

' FontFamily Functions (ALL) ALIAS "Functions" 
declare function GdipCreateFontFamilyFromName Lib "gdiplus" ALIAS "GdipCreateFontFamilyFromName" (ByVal name As String, ByVal fontCollection As Long, fontFamily As Long) AS LONG 
declare function GdipDeleteFontFamily Lib "gdiplus" ALIAS "GdipDeleteFontFamily" (ByVal fontFamily As Long) AS LONG 
declare function GdipCloneFontFamily Lib "gdiplus" ALIAS "GdipCloneFontFamily" (ByVal fontFamily As Long, clonedFontFamily As Long) AS LONG 
declare function GdipGetGenericFontFamilySansSerif Lib "gdiplus" ALIAS "GdipGetGenericFontFamilySansSerif" (nativeFamily As Long) AS LONG 
declare function GdipGetGenericFontFamilySerif Lib "gdiplus" ALIAS "GdipGetGenericFontFamilySerif" (nativeFamily As Long) AS LONG 
declare function GdipGetGenericFontFamilyMonospace Lib "gdiplus" ALIAS "GdipGetGenericFontFamilyMonospace" (nativeFamily As Long) AS LONG 
' NOTE: name must be ALIAS "name" LF_FACESIZE in length or less 
declare function GdipGetFamilyName Lib "gdiplus" ALIAS "GdipGetFamilyName" (ByVal family As Long, ByVal name As String, ByVal language As Integer) AS LONG 
declare function GdipIsStyleAvailable Lib "gdiplus" ALIAS "GdipIsStyleAvailable" (ByVal family As Long, ByVal style As Long, IsStyleAvailable As Long) AS LONG 
declare function GdipFontCollectionEnumerable Lib "gdiplus" ALIAS "GdipFontCollectionEnumerable" (ByVal fontCollection As Long, ByVal graphics As Long, numFound As Long) AS LONG 
declare function GdipFontCollectionEnumerate Lib "gdiplus" ALIAS "GdipFontCollectionEnumerate" (ByVal fontCollection As Long, ByVal numSought As Long, gpfamilies As Long, ByVal numFound As Long, ByVal graphics As Long) AS LONG 
declare function GdipGetEmHeight Lib "gdiplus" ALIAS "GdipGetEmHeight" (ByVal family As Long, ByVal style As Long, EmHeight As Integer) AS LONG 
declare function GdipGetCellAscent Lib "gdiplus" ALIAS "GdipGetCellAscent" (ByVal family As Long, ByVal style As Long, CellAscent As Integer) AS LONG 
declare function GdipGetCellDescent Lib "gdiplus" ALIAS "GdipGetCellDescent" (ByVal family As Long, ByVal style As Long, CellDescent As Integer) AS LONG 
declare function GdipGetLineSpacing Lib "gdiplus" ALIAS "GdipGetLineSpacing" (ByVal family As Long, ByVal style As Long, LineSpacing As Integer) AS LONG 

' Font Functions (ALL) ALIAS "Functions" 
'declare function GdipCreateFontFromDC Lib "gdiplus" ALIAS "GdipCreateFontFromDC" (ByVal hdc As Long, createdfont As Long) AS LONG 
'declare function GdipCreateFontFromLogfontA Lib "gdiplus" ALIAS "GdipCreateFontFromLogfontA" (ByVal hdc As Long, logfont As LOGFONTA, createdfont As Long) AS LONG 
'declare function GdipCreateFontFromLogfontW Lib "gdiplus" ALIAS "GdipCreateFontFromLogfontW" (ByVal hdc As Long, logfont As LOGFONTW, createdfont As Long) AS LONG 
'declare function GdipCreateFont Lib "gdiplus" ALIAS "GdipCreateFont" (ByVal fontFamily As Long, ByVal emSize As Single, ByVal style As FontStyle, ByVal unit As long, createdfont As Long) AS LONG 
'declare function GdipCloneFont Lib "gdiplus" ALIAS "GdipCloneFont" (ByVal curFont As Long, cloneFont As Long) AS LONG 
'declare function GdipDeleteFont Lib "gdiplus" ALIAS "GdipDeleteFont" (ByVal curFont As Long) AS LONG 
'declare function GdipGetFamily Lib "gdiplus" ALIAS "GdipGetFamily" (ByVal curFont As Long, family As Long) AS LONG 
'declare function GdipGetFontStyle Lib "gdiplus" ALIAS "GdipGetFontStyle" (ByVal curFont As Long, style As Long) AS LONG 
'declare function GdipGetFontSize Lib "gdiplus" ALIAS "GdipGetFontSize" (ByVal curFont As Long, size As Single) AS LONG 
'declare function GdipGetFontUnit Lib "gdiplus" ALIAS "GdipGetFontUnit" (ByVal curFont As Long, unit As long) AS LONG 
'declare function GdipGetFontHeight Lib "gdiplus" ALIAS "GdipGetFontHeight" (ByVal curFont As Long, ByVal graphics As Long, Height As Single) AS LONG 
'declare function GdipGetFontHeightGivenDPI Lib "gdiplus" ALIAS "GdipGetFontHeightGivenDPI" (ByVal curFont As Long, ByVal dpi As Single, Height As Single) AS LONG 
'declare function GdipGetLogFontA Lib "gdiplus" ALIAS "GdipGetLogFontA" (ByVal curFont As Long, ByVal graphics As Long, logfont As LOGFONTA) AS LONG 
'declare function GdipGetLogFontW Lib "gdiplus" ALIAS "GdipGetLogFontW" (ByVal curFont As Long, ByVal graphics As Long, logfont As LOGFONTW) AS LONG 
'declare function GdipNewInstalledFontCollection Lib "gdiplus" ALIAS "GdipNewInstalledFontCollection" (fontCollection As Long) AS LONG 
'declare function GdipNewPrivateFontCollection Lib "gdiplus" ALIAS "GdipNewPrivateFontCollection" (fontCollection As Long) AS LONG 
'declare function GdipDeletePrivateFontCollection Lib "gdiplus" ALIAS "GdipDeletePrivateFontCollection" (fontCollection As Long) AS LONG 
'declare function GdipGetFontCollectionFamilyCount Lib "gdiplus" ALIAS "GdipGetFontCollectionFamilyCount" (ByVal fontCollection As Long, numFound As Long) AS LONG 
'declare function GdipGetFontCollectionFamilyList Lib "gdiplus" ALIAS "GdipGetFontCollectionFamilyList" (ByVal fontCollection As Long, ByVal numSought As Long, gpfamilies As Long, numFound As Long) AS LONG 
'declare function GdipPrivateAddFontFile Lib "gdiplus" ALIAS "GdipPrivateAddFontFile" (ByVal fontCollection As Long, ByVal filename As String) AS LONG 
'declare function GdipPrivateAddMemoryFont Lib "gdiplus" ALIAS "GdipPrivateAddMemoryFont" (ByVal fontCollection As Long, ByVal memory As Long, ByVal length As Long) AS LONG 

' Text Functions (ALL) ALIAS "Functions" 
'declare function GdipDrawString Lib "gdiplus" ALIAS "GdipDrawString" (ByVal graphics As Long, ByVal str As String, ByVal length As Long, ByVal thefont As Long, layoutRect As long, ByVal StringFormat As Long, ByVal brush As Long) AS
'declare function GdipMeasureString Lib "gdiplus" ALIAS "GdipMeasureString" (ByVal graphics As Long, ByVal str As String, ByVal length As Long, ByVal thefont As Long, layoutRect As long, ByVal StringFormat As Long, boundingBox As long, codepointsFitted As
'declare function GdipMeasureCharacterRanges Lib "gdiplus" ALIAS "GdipMeasureCharacterRanges" (ByVal graphics As Long, ByVal str As String, ByVal length As Long, ByVal thefont As Long, layoutRect As long, ByVal StringFormat As Long, ByVal regionCount As Long, regions
'declare function GdipDrawDriverString Lib "gdiplus" ALIAS "GdipDrawDriverString" (ByVal graphics As Long, ByVal str As String, ByVal length As Long, ByVal thefont As Long, ByVal brush As Long, positions As long, ByVal flags As Long, ByVal
'declare function GdipMeasureDriverString Lib "gdiplus" ALIAS "GdipMeasureDriverString" (ByVal graphics As Long, ByVal str As String, ByVal length As Long, ByVal thefont As Long, positions As long, ByVal flags As Long, ByVal matrix As Long, boundingBox
'
'' String format Functions (ALL) ALIAS "format" 
'declare function GdipCreateStringFormat Lib "gdiplus" ALIAS "GdipCreateStringFormat" (ByVal formatAttributes As Long, ByVal language As Integer, StringFormat As Long) AS LONG 
'declare function GdipStringFormatGetGenericDefault Lib "gdiplus" ALIAS "GdipStringFormatGetGenericDefault" (StringFormat As Long) AS LONG 
'declare function GdipStringFormatGetGenericTypographic Lib "gdiplus" ALIAS "GdipStringFormatGetGenericTypographic" (StringFormat As Long) AS LONG 
'declare function GdipDeleteStringFormat Lib "gdiplus" ALIAS "GdipDeleteStringFormat" (ByVal StringFormat As Long) AS LONG 
'declare function GdipCloneStringFormat Lib "gdiplus" ALIAS "GdipCloneStringFormat" (ByVal StringFormat As Long, newFormat As Long) AS LONG 
'declare function GdipSetStringFormatFlags Lib "gdiplus" ALIAS "GdipSetStringFormatFlags" (ByVal StringFormat As Long, ByVal flags As Long) AS LONG 
'declare function GdipGetStringFormatFlags Lib "gdiplus" ALIAS "GdipGetStringFormatFlags" (ByVal StringFormat As Long, flags As Long) AS LONG 
'declare function GdipSetStringFormatAlign Lib "gdiplus" ALIAS "GdipSetStringFormatAlign" (ByVal StringFormat As Long, ByVal align As StringAlignment) AS LONG 
'declare function GdipGetStringFormatAlign Lib "gdiplus" ALIAS "GdipGetStringFormatAlign" (ByVal StringFormat As Long, align As StringAlignment) AS LONG 
'declare function GdipSetStringFormatLineAlign Lib "gdiplus" ALIAS "GdipSetStringFormatLineAlign" (ByVal StringFormat As Long, ByVal align As StringAlignment) AS LONG 
'declare function GdipGetStringFormatLineAlign Lib "gdiplus" ALIAS "GdipGetStringFormatLineAlign" (ByVal StringFormat As Long, align As StringAlignment) AS LONG 
'declare function GdipSetStringFormatTrimming Lib "gdiplus" ALIAS "GdipSetStringFormatTrimming" (ByVal StringFormat As Long, ByVal trimming As StringTrimming) AS LONG 
'declare function GdipGetStringFormatTrimming Lib "gdiplus" ALIAS "GdipGetStringFormatTrimming" (ByVal StringFormat As Long, trimming As Long) AS LONG 
'declare function GdipSetStringFormatHotkeyPrefix Lib "gdiplus" ALIAS "GdipSetStringFormatHotkeyPrefix" (ByVal StringFormat As Long, ByVal hkPrefix As HotkeyPrefix) AS LONG 
'declare function GdipGetStringFormatHotkeyPrefix Lib "gdiplus" ALIAS "GdipGetStringFormatHotkeyPrefix" (ByVal StringFormat As Long, hkPrefix As HotkeyPrefix) AS LONG 
'declare function GdipSetStringFormatTabStops Lib "gdiplus" ALIAS "GdipSetStringFormatTabStops" (ByVal StringFormat As Long, ByVal firstTabOffset As Single, ByVal count As Long, tabStops As Single) AS LONG 
'declare function GdipGetStringFormatTabStops Lib "gdiplus" ALIAS "GdipGetStringFormatTabStops" (ByVal StringFormat As Long, ByVal count As Long, firstTabOffset As Single, tabStops As Single) AS LONG 
'declare function GdipGetStringFormatTabStopCount Lib "gdiplus" ALIAS "GdipGetStringFormatTabStopCount" (ByVal StringFormat As Long, count As Long) AS LONG 
'declare function GdipSetStringFormatDigitSubstitution Lib "gdiplus" ALIAS "GdipSetStringFormatDigitSubstitution" (ByVal StringFormat As Long, ByVal language As Integer, ByVal substitute As StringDigitSubstitute) AS LONG 
'declare function GdipGetStringFormatDigitSubstitution Lib "gdiplus" ALIAS "GdipGetStringFormatDigitSubstitution" (ByVal StringFormat As Long, language As Integer, substitute As StringDigitSubstitute) AS LONG 
'declare function GdipGetStringFormatMeasurableCharacterRangeCount Lib "gdiplus" ALIAS "GdipGetStringFormatMeasurableCharacterRangeCount" (ByVal StringFormat As Long, count As Long) AS LONG 
'declare function GdipSetStringFormatMeasurableCharacterRanges Lib "gdiplus" ALIAS "GdipSetStringFormatMeasurableCharacterRanges" (ByVal StringFormat As Long, ByVal rangeCount As Long, ranges As CharacterRange) AS LONG 
'

' Built-in encoders for saving: (You can *try* to get other types also)
'   image/bmp
'   image/jpeg
'   image/gif
'   image/tiff
'   image/png

' From www.mvps.org/vbnet...i think
'   Dereferences an ANSI or Unicode string pointer
'   and returns a normal VB BSTR
'Public Function PtrToStrW(ByVal lpsz As Long) As String
'    Dim sOut As String
'    Dim lLen As Long
'
'    lLen = lstrlenW(lpsz)
'
'    If (lLen > 0) Then
'        sOut = StrConv(String$(lLen, vbNullChar), vbUnicode)
'        Call CopyMemory(ByVal sOut, ByVal lpsz, lLen * 2)
'        PtrToStrW = StrConv(sOut, vbFromUnicode)
'    End If
'End Function
'
'Public Function PtrToStrA(ByVal lpsz As Long) As String
'    Dim sOut As String
'    Dim lLen As Long
'
'    lLen = lstrlenA(lpsz)
'
'    If (lLen > 0) Then
'        sOut = String$(lLen, vbNullChar)
'        Call CopyMemory(ByVal sOut, ByVal lpsz, lLen)
'        PtrToStrA = sOut
'    End If
'End Function
'
'' This should hopefully simplify property item value retrieval
'' NOTE: We are raising errors in this function; ensure the caller has error handing code.
''       The resulting arrays are using a base of one.
'Public Function GetPropValue(item As long) As Variant
'   ' We need a valid pointer and length
'   If item.value = 0 Or item.length = 0 Then Err.Raise 5, "GetPropValue"
'
'   Select Case item.type
'      ' We'll make Undefined types a Btye array as it seems the safest choice...
'      Case PropertyTagTypeByte, PropertyTagTypeUndefined:
'         Dim bte() As Byte: ReDim bte(1 To item.length)
'         CopyMemory bte(1), ByVal item.value, item.length
'         GetPropValue = bte
'         Erase bte
'
'      Case PropertyTagTypeASCII:
'         GetPropValue = PtrToStrA(item.value)
'         
'      Case PropertyTagTypeShort:
'         Dim short() As Integer: ReDim short(1 To (item.length / 2))
'         CopyMemory short(1), ByVal item.value, item.length
'         GetPropValue = short
'         Erase short
'         
'      Case PropertyTagTypeLong, PropertyTagTypeSLONG:
'         Dim lng() As Long: ReDim lng(1 To (item.length / 4))
'         CopyMemory lng(1), ByVal item.value, item.length
'         GetPropValue = lng
'         Erase lng
'         
'      Case PropertyTagTypeRational, PropertyTagTypeSRational:
'         Dim lngpair() As Long: ReDim lngpair(1 To (item.length / 8), 1 To 2)
'         CopyMemory lngpair(1, 1), ByVal item.value, item.length
'         GetPropValue = lngpair
'         Erase lngpair
'
'      Case Else: Err.Raise 461, "GetPropValue"
'   End Select
'End Function

$ENDIF