//GDI+ For AAuto
//http://msdn.microsoft.com/en-us/library/ms534041(VS.85).aspx
namespace  gdip;  
import win;
import win.guid;
import win.gdi;//定义了LOGFONT
import win.ole.image

import gdip.stringformat;
import gdip.family;
import gdip.path
import gdip.bitmap;
import gdip.image;
import gdip.graphics;

errMsg ={
"GenericError! an error on the method call."; // Status 1 
"InvalidParameter!";       // Status 2 
"OutOfMemory!";         // Status 3 
"ObjectBusy!";         // Status 4 
"InsufficientBuffer!";       // Status 5 
"NotImplemented!";        // Status 6 
"Win32Error!";         // Status 7 
"WrongState!";         // Status 8 
"Aborted!";          // Status 9 
"FileNotFound!";        // Status 10 
"ValueOverflow!";        // Status 11 
"AccessDenied!";        // Status 12 
"UnknownImageFormat!";       // Status 13 
"FontFamilyNotFound!";       // Status 14 
"FontStyleNotFound!";       // Status 15 
"NotTrueTypeFont!";        // Status 16 
"UnsupportedGdiplusVersion!";     // Status 17 
"GdiplusNotInitialized!";      // Status 18 
"PropertyNotFound!";       // Status 19 
"PropertyNotSupported!";      // Status 20 
"ProfileNotFound!";        // Status 21
}
 
Status = {
/*intellisense(gdip.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;
ProfileNotFound = 21;
/*end intellisense*/
};   

/*intellisense(gdip)*/ 
 
RECTF = class{
	ctor(left=0,top=0,right=0,bottom=0){
  		this.left = left;
  		this.top = top;
  		this.right = right;
  		this.bottom = bottom;
	} 
	float left;
	float top;
	float right;
	float bottom;
}

POINTF = class{
	ctor(x=0,y=0){
  	this.x = x;
  	this.y = y;
	} 
	float x ; 
	float y ;
}

/*
SIZEF = class{ 
float cx; 
float cy; 
}
*/
 
//Bitmap Structure


BITMAPINFOHEADER= class{
int biSize;
int biWidth;
int biHeight;
word biPlanes;
word biBitCount;
int biCompression;
int biSizeImage;
int biXPelsPerMeter;
int biYPelsPerMeter;
int biClrUsed;
int biClrImportant;
}

BITMAPINFO= class{
struct bmiHeader;
struct bmiColors;
}

BitmapData= class{ 
 
	int Width;
	int Height;
	int Stride;
	int PixelFormat;
	pointer Scan0;
	int Reserved; 
	
}



 
//=================================
//Color Structure
COLORBYTES= class{
byte BlueByte;
byte GreenByte;
byte RedByte;
byte AlphaByte;
}

COLORLONG= class{
int longval;
}

ColorMap= class{
int oldColor;
int newColor;
}

ColorMatrix= class{
struct m = {
float m1[5];
float m2[5];
float m3[5];
float m4[5];
float m5[5];
}
}

//=================================
//Path
PathData= class{
int count;
pointer Points;
// Pointer to POINTF array
pointer types;
// Pointer to BYTE array
}

//================================= 



/*end intellisense*/


//=================================
//== Enums                       ==
//=================================

//=================================
//Pixel
GpPixelFormat={ 
/*intellisense(gdip.GpPixelFormat)*/ 
PixelFormat1bppIndexed = 0x30101;
PixelFormat4bppIndexed = 0x30402;
PixelFormat8bppIndexed = 0x30803;
PixelFormat16bppGreyScale = 0x101004;
PixelFormat16bppRGB555 = 0x21005;
PixelFormat16bppRGB565 = 0x21006;
PixelFormat16bppARGB1555 = 0x61007;
PixelFormat24bppRGB = 0x21808;
PixelFormat32bppRGB = 0x22009;
PixelFormat32bppARGB = 0x26200A;
PixelFormat32bppPARGB = 0xE200B;
PixelFormat48bppRGB = 0x10300C;
PixelFormat64bppARGB = 0x34400D;
PixelFormat64bppPARGB = 0x1C400E;
/*end intellisense*/
}

//=================================
//Unit
GpUnit={ 
/*intellisense(gdip.GpUnit)*/  
UnitWorld=0;
UnitDisplay=1;
UnitPixel=2;
UnitPoint=3;
UnitInch=4;
UnitDocument=5;
UnitMillimeter=6;
/*end intellisense*/
}
var GpUnit = GpUnit;

//=================================
//Path
PathPointType={ 
/*intellisense(gdip.PathPointType)*/  
PathPointTypeStart = 0;
PathPointTypeLine = 1;
PathPointTypeBezier = 3;
PathPointTypePathTypeMask = 0x7;
PathPointTypePathDashMode = 0x10;
PathPointTypePathMarker = 0x20;
PathPointTypeCloseSubpath = 0x80;
PathPointTypeBezier3 = 3;
/*end intellisense*/
}

//=================================
//Font / string
GenericFontFamily={ 
/*intellisense(gdip.GenericFontFamily)*/  
GenericFontFamilySerif=0;
GenericFontFamilySansSerif=1;
GenericFontFamilyMonospace=2;
/*end intellisense*/
}

FontStyle={ 
/*intellisense(gdip.FontStyle)*/  
FontStyleRegular = 0;
FontStyleBold = 1;
FontStyleItalic = 2;
FontStyleBoldItalic = 3;
FontStyleUnderline = 4;
FontStyleStrikeout = 8;
/*end intellisense*/
}

StringAlignment={ 
/*intellisense(gdip.StringAlignment)*/  
StringAlignmentNear = 0;
StringAlignmentCenter = 1;
StringAlignmentFar = 2;
/*end intellisense*/
}

//=================================
//Fill / Wrap
FillMode={ 
/*intellisense(gdip.FillMode)*/  
FillModeAlternate=0;
FillModeWinding=1;
/*end intellisense*/
}

WrapMode={ 
/*intellisense(gdip.WrapMode)*/  
WrapModeTile=0;
WrapModeTileFlipX=1;
WrapModeTileFlipY=2;
WrapModeTileFlipXY=3;
WrapModeClamp=4;
/*end intellisense*/
}

LinearGradientMode={ 
/*intellisense(gdip.LinearGradientMode)*/  
LinearGradientModeHorizontal=0;
LinearGradientModeVertical=1;
LinearGradientModeForwardDiagonal=2;
LinearGradientModeBackwardDiagonal=3;
/*end intellisense*/
}

//=================================
//Quality
QualityMode={ 
/*intellisense(gdip.QualityMode)*/  
QualityModeInvalid = -1;
QualityModeDefault = 0;
QualityModeLow = 1;
QualityModeHigh = 2;
/*end intellisense*/
}

CompositingMode={ 
/*intellisense(gdip.CompositingMode)*/  
CompositingModeSourceOver=0;
CompositingModeSourceCopy=1;
/*end intellisense*/
}

CompositingQuality={ 
/*intellisense(gdip.CompositingQuality)*/  
CompositingQualityInvalid = QualityMode.QualityModeInvalid;
CompositingQualityDefault = QualityMode.QualityModeDefault;
CompositingQualityHighSpeed = QualityMode.QualityModeLow;
CompositingQualityHighQuality = QualityMode.QualityModeHigh;
CompositingQualityGammaCorrected = 3;
CompositingQualityAssumeLinear = 4;
/*end intellisense*/
}

SmoothingMode={ 
/*intellisense(gdip.SmoothingMode)*/  
SmoothingModeInvalid = QualityMode.QualityModeInvalid;
SmoothingModeDefault = QualityMode.QualityModeDefault;
SmoothingModeHighSpeed = QualityMode.QualityModeLow;
SmoothingModeHighQuality = QualityMode.QualityModeHigh;
SmoothingModeNone = 3;
SmoothingModeAntiAlias =4;
/*end intellisense*/
}

InterpolationMode={ 
/*intellisense(gdip.InterpolationMode)*/  
InterpolationModeInvalid = QualityMode.QualityModeInvalid;
InterpolationModeDefault = QualityMode.QualityModeDefault;
InterpolationModeLowQuality = QualityMode.QualityModeLow;
InterpolationModeHighQuality = QualityMode.QualityModeHigh;
InterpolationModeBilinear = 3;
InterpolationModeBicubic = 4;
InterpolationModeNearestNeighbor = 5;
InterpolationModeHighQualityBilinear = 6;
InterpolationModeHighQualityBicubic = 7;
/*end intellisense*/
}

PixelOffsetMode={ 
/*intellisense(gdip.PixelOffsetMode)*/  
PixelOffsetModeInvalid = QualityMode.QualityModeInvalid;
PixelOffsetModeDefault = QualityMode.QualityModeDefault;
PixelOffsetModeHighSpeed = QualityMode.QualityModeLow;
PixelOffsetModeHighQuality = QualityMode.QualityModeHigh;
PixelOffsetModeNone = 3;    // No pixel offset;
PixelOffsetModeHalf = 4;     // Offset by -0.5 -0.5 for fast anti-alias perf;
/*end intellisense*/
}

TextRenderingHint={ 
/*intellisense(gdip.TextRenderingHint)*/  
TextRenderingHintSystemDefault = 0; // Glyph with system default rendering hint;
TextRenderingHintSingleBitPerPixelGridFit = 1;    // Glyph bitmap with hinting;
TextRenderingHintSingleBitPerPixel = 2;           // Glyph bitmap without hinting;
TextRenderingHintAntiAliasGridFit  = 3;           // Glyph anti-alias bitmap with hinting;
TextRenderingHintAntiAlias  = 4;                 // Glyph anti-alias bitmap without hinting;
TextRenderingHintClearTypeGridFit = 5;            // Glyph CT bitmap with hinting;
/*end intellisense*/
}

//=================================
//Color Matrix
MatrixOrder={ 
/*intellisense(gdip.intellisense)*/  
MatrixOrderPrepend = 0;
MatrixOrderAppend = 1;
/*end intellisense*/
}

ColorAdjustType={ 
/*intellisense(gdip.ColorAdjustType)*/  
ColorAdjustTypeDefault = 0;
ColorAdjustTypeBitmap = 1;
ColorAdjustTypeBrush = 2;
ColorAdjustTypePen = 3;
ColorAdjustTypeText = 4;
ColorAdjustTypeCount = 5;
ColorAdjustTypeAny = 6;
/*end intellisense*/
}

ColorMatrixFlags={ 
/*intellisense(gdip.ColorMatrixFlags)*/  
ColorMatrixFlagsDefault = 0;
ColorMatrixFlagsSkipGrays = 1;
ColorMatrixFlagsAltGray = 2;
/*end intellisense*/
}

WarpMode={ 
/*intellisense(gdip.WarpMode)*/  
WarpModePerspective     =0;
WarpModeBilinear        =1;
/*end intellisense*/
}

CombineMode={ 
/*intellisense(gdip.CombineMode)*/  
CombineModeReplace      =0;
CombineModeIntersect    =1;
CombineModeUnion        =2;
CombineModeXor          =3;
CombineModeExclude      =4;
CombineModeComplement   =5;// (Exclude From)
/*end intellisense*/
}

ImageLockMode={ 
/*intellisense(gdip.ImageLockMode)*/  
ImageLockModeRead = 0x1;
ImageLockModeWrite = 0x2;
ImageLockModeUserInputBuf = 0x4;
/*end intellisense*/
}



::Gdiplus := ..raw.loadDll("Gdiplus.dll")

/*intellisense(gdip)*/  
self.GetDC = Gdiplus.api("GdipGetDC","int(POINTER Graphics,pointer& hDC)")
self.ReleaseDC = Gdiplus.api("GdipReleaseDC","int(POINTER Graphics,POINTER hDc)")

//==================================================
CreateFromHDC = Gdiplus.api("GdipCreateFromHDC","int(POINTER hDc,pointer& Graphics)")
CreateFromHWND = Gdiplus.api("GdipCreateFromHWND","int(int hwnd,pointer& Graphics)")
GetImageGraphicsContext = Gdiplus.api("GdipGetImageGraphicsContext","int(POINTER Image,pointer& Graphics)")
DeleteGraphics = Gdiplus.api("GdipDeleteGraphics","int(POINTER Graphics)")
GraphicsClear = Gdiplus.api("GdipGraphicsClear","int(POINTER Graphics,int lColor)")

SetCompositingMode = Gdiplus.api("GdipSetCompositingMode","int(POINTER Graphics,struct CompositingMd)")
GetCompositingMode = Gdiplus.api("GdipGetCompositingMode","int(POINTER Graphics,struct& CompositingMd)")
SetRenderingOrigin = Gdiplus.api("GdipSetRenderingOrigin","int(POINTER Graphics,int x,int y)")
GetRenderingOrigin = Gdiplus.api("GdipGetRenderingOrigin","int(POINTER Graphics,int& x,int& y)")
SetCompositingQuality = Gdiplus.api("GdipSetCompositingQuality","int(POINTER Graphics,struct CompositingQlty)")
GetCompositingQuality = Gdiplus.api("GdipGetCompositingQuality","int(POINTER Graphics,struct& CompositingQlty)")
SetSmoothingMode = Gdiplus.api("GdipSetSmoothingMode","int(POINTER Graphics,int SmoothingMd)")
GetSmoothingMode = Gdiplus.api("GdipGetSmoothingMode","int(POINTER Graphics,struct& SmoothingMd)")
SetPixelOffsetMode = Gdiplus.api("GdipSetPixelOffsetMode","int(POINTER Graphics,struct PixOffsetMode)")
GetPixelOffsetMode = Gdiplus.api("GdipGetPixelOffsetMode","int(POINTER Graphics,struct& PixOffsetMode)")
SetTextRenderingHint = Gdiplus.api("GdipSetTextRenderingHint","int(POINTER Graphics,int Mode)")
GetTextRenderingHint = Gdiplus.api("GdipGetTextRenderingHint","int(POINTER Graphics,struct& Mode)")
SetTextContrast = Gdiplus.api("GdipSetTextContrast","int(POINTER Graphics,int contrast)")
GetTextContrast = Gdiplus.api("GdipGetTextContrast","int(POINTER Graphics,int& contrast)")
SetInterpolationMode = Gdiplus.api("GdipSetInterpolationMode","int(POINTER Graphics,int interpolation)")
GetInterpolationMode = Gdiplus.api("GdipGetInterpolationMode","int(POINTER Graphics,struct& interpolation)")

SetWorldTransform = Gdiplus.api("GdipSetWorldTransform","int(POINTER Graphics,int matrix)")
ResetWorldTransform = Gdiplus.api("GdipResetWorldTransform","int(POINTER Graphics)")
MultiplyWorldTransform = Gdiplus.api("GdipMultiplyWorldTransform","int(POINTER Graphics,int matrix,int order)")
TranslateWorldTransform = Gdiplus.api("GdipTranslateWorldTransform","int(POINTER Graphics,float dx,float dy,int order)")
ScaleWorldTransform = Gdiplus.api("GdipScaleWorldTransform","int(POINTER Graphics,float sx,float sy,int order)")
RotateWorldTransform = Gdiplus.api("GdipRotateWorldTransform","int(POINTER Graphics,float angle,int order)")
GetWorldTransform = Gdiplus.api("GdipGetWorldTransform","int(POINTER Graphics,int matrix)")
ResetPageTransform = Gdiplus.api("GdipResetPageTransform","int(POINTER Graphics)")
GetPageUnit = Gdiplus.api("GdipGetPageUnit","int(POINTER Graphics,struct& unit)")
GetPageScale = Gdiplus.api("GdipGetPageScale","int(POINTER Graphics,float& sScale)")
SetPageUnit = Gdiplus.api("GdipSetPageUnit","int(POINTER Graphics,int unit)")
SetPageScale = Gdiplus.api("GdipSetPageScale","int(POINTER Graphics,float sScale)")
GetDpiX = Gdiplus.api("GdipGetDpiX","int(POINTER Graphics,float& dpi)")
GetDpiY = Gdiplus.api("GdipGetDpiY","int(POINTER Graphics,float& dpi)")
TransformPoints = Gdiplus.api("GdipTransformPoints","int(POINTER Graphics,struct destSpace,struct srcSpace,struct  Points,int count)")
TransformPointsI = Gdiplus.api("GdipTransformPointsI","int(POINTER Graphics,struct destSpace,struct srcSpace,struct  Points,int count)")
GetNearestColor = Gdiplus.api("GdipGetNearestColor","int(POINTER Graphics,int& argb)")
CreateHalftonePalette = Gdiplus.api("GdipCreateHalftonePalette","int()")

SetClipGraphics = Gdiplus.api("GdipSetClipGraphics","int(POINTER Graphics,int srcgraphics,int CombineMd)")
SetClipRect = Gdiplus.api("GdipSetClipRect","int(POINTER Graphics,float x,float y,float Width,float Height,int CombineMd)")
SetClipRectI = Gdiplus.api("GdipSetClipRectI","int(POINTER Graphics,int x,int y,int Width,int Height,int CombineMd)")
SetClipPath = Gdiplus.api("GdipSetClipPath","int(POINTER Graphics,pointer Path,int CombineMd)")
SetClipRegion = Gdiplus.api("GdipSetClipRegion","int(POINTER Graphics,int region,int CombineMd)")
SetClipHrgn = Gdiplus.api("GdipSetClipHrgn","int(POINTER Graphics,int hRgn,int CombineMd)")
ResetClip = Gdiplus.api("GdipResetClip","int(POINTER Graphics)")

TranslateClip = Gdiplus.api("GdipTranslateClip","int(POINTER Graphics,float dx,float dy)")
TranslateClipI = Gdiplus.api("GdipTranslateClipI","int(POINTER Graphics,int dx,int dy)")
GetClip = Gdiplus.api("GdipGetClip","int(POINTER Graphics,int region)")
GetClipBounds = Gdiplus.api("GdipGetClipBounds","int(POINTER Graphics,struct& rect)")
GetClipBoundsI = Gdiplus.api("GdipGetClipBoundsI","int(POINTER Graphics,struct& rect)")

IsClipEmpty = Gdiplus.api("GdipIsClipEmpty","int(POINTER Graphics,int& result)")
GetVisibleClipBounds = Gdiplus.api("GdipGetVisibleClipBounds","int(POINTER Graphics,struct& rect)")
GetVisibleClipBoundsI = Gdiplus.api("GdipGetVisibleClipBoundsI","int(POINTER Graphics,struct& rect)")
IsVisibleClipEmpty = Gdiplus.api("GdipIsVisibleClipEmpty","int(POINTER Graphics,int& result)")

IsVisiblePoint = Gdiplus.api("GdipIsVisiblePoint","int(POINTER Graphics,float x,float y,int& result)")
IsVisiblePointI = Gdiplus.api("GdipIsVisiblePointI","int(POINTER Graphics,int x,int y,int& result)")
IsVisibleRect = Gdiplus.api("GdipIsVisibleRect","int(POINTER Graphics,float x,float y,float Width,float Height,int& result)")
IsVisibleRectI = Gdiplus.api("GdipIsVisibleRectI","int(POINTER Graphics,int x,int y,int Width,int Height,int& result)")

SaveGraphics = Gdiplus.api("GdipSaveGraphics","int(POINTER Graphics,int& state)")
RestoreGraphics = Gdiplus.api("GdipRestoreGraphics","int(POINTER Graphics,int state)")
BeginContainer = Gdiplus.api("GdipBeginContainer","int(POINTER Graphics,struct& dstRect,struct& srcRect,int unit,int& state)")
BeginContainerI = Gdiplus.api("GdipBeginContainerI","int(POINTER Graphics,struct& dstRect,struct& srcRect,int unit,int& state)")
BeginContainer2 = Gdiplus.api("GdipBeginContainer2","int(POINTER Graphics,int& state)")
EndContainer = Gdiplus.api("GdipEndContainer","int(POINTER Graphics,int state)")

//==================================================

DrawLine = Gdiplus.api("GdipDrawLine","int(POINTER Graphics,pointer pen,float x1,float y1,float x2,float y2)")
DrawLineI = Gdiplus.api("GdipDrawLineI","int(POINTER Graphics,pointer pen,int x1,int y1,int x2,int y2)")
DrawLines = Gdiplus.api("GdipDrawLines","int(POINTER Graphics,pointer pen,struct  Points,int count)")
DrawLinesI = Gdiplus.api("GdipDrawLinesI","int(POINTER Graphics,pointer pen,struct  Points,int count)")

//==================================================

DrawArc = Gdiplus.api("GdipDrawArc","int(POINTER Graphics,pointer pen,float x,float y,float Width,float Height,float startAngle,float sweepAngle)")
DrawArcI = Gdiplus.api("GdipDrawArcI","int(POINTER Graphics,pointer pen,int x,int y,int Width,int Height,float startAngle,float sweepAngle)")

//==================================================

DrawBezier = Gdiplus.api("GdipDrawBezier","int(POINTER Graphics,pointer pen,float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4)")
DrawBezierI = Gdiplus.api("GdipDrawBezierI","int(POINTER Graphics,pointer pen,int x1,int y1,int x2,int y2,int x3,int y3,int x4,int y4)")
DrawBeziers = Gdiplus.api("GdipDrawBeziers","int(POINTER Graphics,pointer pen,struct  Points,int count)")

//==================================================

DrawBeziersI = Gdiplus.api("GdipDrawBeziersI","int(POINTER Graphics,pointer pen,struct  Points,int count)")
DrawRectangle = Gdiplus.api("GdipDrawRectangle","int(POINTER Graphics,pointer pen,float x,float y,float Width,float Height)")
DrawRectangleI = Gdiplus.api("GdipDrawRectangleI","int(POINTER Graphics,pointer pen,int x,int y,int Width,int Height)")
DrawRectangles = Gdiplus.api("GdipDrawRectangles","int(POINTER Graphics,pointer pen,struct& rects,int count)")
DrawRectanglesI = Gdiplus.api("GdipDrawRectanglesI","int(POINTER Graphics,pointer pen,struct& rects,int count)")

FillRectangle = Gdiplus.api("GdipFillRectangle","int(POINTER Graphics,pointer Brush,float x,float y,float Width,float Height)")
FillRectangleI = Gdiplus.api("GdipFillRectangleI","int(POINTER Graphics,pointer Brush,int x,int y,int Width,int Height)")
FillRectangles = Gdiplus.api("GdipFillRectangles","int(POINTER Graphics,pointer Brush,struct& rects,int count)")
FillRectanglesI = Gdiplus.api("GdipFillRectanglesI","int(POINTER Graphics,pointer Brush,struct& rects,int count)")

//==================================================

DrawEllipse = Gdiplus.api("GdipDrawEllipse","int(POINTER Graphics,pointer pen,float x,float y,float Width,float Height)")
DrawEllipseI = Gdiplus.api("GdipDrawEllipseI","int(POINTER Graphics,pointer pen,int x,int y,int Width,int Height)")

FillEllipse = Gdiplus.api("GdipFillEllipse","int(POINTER Graphics,pointer Brush,float x,float y,float Width,float Height)")
FillEllipseI = Gdiplus.api("GdipFillEllipseI","int(POINTER Graphics,pointer Brush,int x,int y,int Width,int Height)")

//==================================================

DrawPie = Gdiplus.api("GdipDrawPie","int(POINTER Graphics,pointer pen,float x,float y,float Width,float Height,float startAngle,float sweepAngle)")
DrawPieI = Gdiplus.api("GdipDrawPieI","int(POINTER Graphics,pointer pen,int x,int y,int Width,int Height,float startAngle,float sweepAngle)")

FillPie = Gdiplus.api("GdipFillPie","int(POINTER Graphics,pointer Brush,float x,float y,float Width,float Height,float startAngle,float sweepAngle)")
FillPieI = Gdiplus.api("GdipFillPieI","int(POINTER Graphics,pointer Brush,int x,int y,int Width,int Height,float startAngle,float sweepAngle)")

//==================================================

DrawPolygon = Gdiplus.api("GdipDrawPolygon","int(POINTER Graphics,pointer pen,struct  Points,int count)")
DrawPolygonI = Gdiplus.api("GdipDrawPolygonI","int(POINTER Graphics,pointer pen,struct  Points,int count)")

FillPolygon = Gdiplus.api("GdipFillPolygon","int(POINTER Graphics,pointer Brush,struct  Points,int count,struct FillMd)")
FillPolygonI = Gdiplus.api("GdipFillPolygonI","int(POINTER Graphics,pointer Brush,struct  Points,int count,struct FillMd)")
FillPolygon2 = Gdiplus.api("GdipFillPolygon2","int(POINTER Graphics,pointer Brush,struct  Points,int count)")
FillPolygon2I = Gdiplus.api("GdipFillPolygon2I","int(POINTER Graphics,pointer Brush,struct  Points,int count)")

//==================================================

DrawPath = Gdiplus.api("GdipDrawPath","int(POINTER Graphics,pointer pen,pointer Path)")

FillPath = Gdiplus.api("GdipFillPath","int(POINTER Graphics,pointer Brush,pointer Path)")

//==================================================

DrawCurve = Gdiplus.api("GdipDrawCurve","int(POINTER Graphics,pointer pen,struct  Points,int count)")
DrawCurveI = Gdiplus.api("GdipDrawCurveI","int(POINTER Graphics,pointer pen,struct  Points,int count)")
DrawCurve2 = Gdiplus.api("GdipDrawCurve2","int(POINTER Graphics,pointer pen,struct  Points,int count,float tension)")
DrawCurve2I = Gdiplus.api("GdipDrawCurve2I","int(POINTER Graphics,pointer pen,struct  Points,int count,float tension)")
DrawCurve3 = Gdiplus.api("GdipDrawCurve3","int(POINTER Graphics,pointer pen,struct  Points,int count,int Offset,int numberOfSegments,float tension)")
DrawCurve3I = Gdiplus.api("GdipDrawCurve3I","int(POINTER Graphics,pointer pen,struct  Points,int count,int Offset,int numberOfSegments,float tension)")

DrawClosedCurve = Gdiplus.api("GdipDrawClosedCurve","int(POINTER Graphics,pointer pen,struct  Points,int count)")
DrawClosedCurveI = Gdiplus.api("GdipDrawClosedCurveI","int(POINTER Graphics,pointer pen,struct  Points,int count)")
DrawClosedCurve2 = Gdiplus.api("GdipDrawClosedCurve2","int(POINTER Graphics,pointer pen,struct  Points,int count,float tension)")
DrawClosedCurve2I = Gdiplus.api("GdipDrawClosedCurve2I","int(POINTER Graphics,pointer pen,struct  Points,int count,float tension)")

FillClosedCurve = Gdiplus.api("GdipFillClosedCurve","int(POINTER Graphics,pointer Brush,struct  Points,int count)")
FillClosedCurveI = Gdiplus.api("GdipFillClosedCurveI","int(POINTER Graphics,pointer Brush,struct  Points,int count)")
FillClosedCurve2 = Gdiplus.api("GdipFillClosedCurve2","int(POINTER Graphics,pointer Brush,struct  Points,int count,float tension,struct FillMd)")
FillClosedCurve2I = Gdiplus.api("GdipFillClosedCurve2I","int(POINTER Graphics,pointer Brush,struct  Points,int count,float tension,struct FillMd)")

//==================================================

FillRegion = Gdiplus.api("GdipFillRegion","int(POINTER Graphics,pointer Brush,int region)")

//==================================================

DrawImage = Gdiplus.api("GdipDrawImage","int(POINTER Graphics,pointer Image,float x,float y)")
DrawImageI = Gdiplus.api("GdipDrawImageI","int(POINTER Graphics,pointer Image,int x,int y)")

DrawImageRect = Gdiplus.api("GdipDrawImageRect","int(POINTER Graphics,pointer Image,float x,float y,float Width,float Height)")
DrawImageRectI = Gdiplus.api("GdipDrawImageRectI","int(POINTER Graphics,pointer Image,int x,int y,int Width,int Height)")
DrawImagePoints = Gdiplus.api("GdipDrawImagePoints","int(POINTER Graphics,pointer Image,struct& dstpoints,int count)")
DrawImagePointsI = Gdiplus.api("GdipDrawImagePointsI","int(POINTER Graphics,pointer Image,struct& dstpoints,int count)")
DrawImagePointRect = Gdiplus.api("GdipDrawImagePointRect","int(POINTER Graphics,pointer Image,float x,float y,float srcx,float srcy,float srcwidth,float srcheight,struct srcUnit)")
DrawImagePointRectI = Gdiplus.api("GdipDrawImagePointRectI","int(POINTER Graphics,pointer Image,int x,int y,int srcx,int srcy,int srcwidth,int srcheight,struct srcUnit)")
DrawImageRectRect = Gdiplus.api("GdipDrawImageRectRect","int(POINTER Graphics,pointer Image,float dstX,float dstY,int dstWidth,float dstHeight,float srcx,float srcy,float srcwidth,float srcheight,int srcUnit,int imageAttributes ,pointer callback,pointer callbackData )")
DrawImageRectRectI = Gdiplus.api("GdipDrawImageRectRectI","int(POINTER Graphics,pointer Image,int dstX,int dstY,int dstWidth,int dstHeight,int srcx,int srcy,int srcwidth,int srcheight,int srcUnit,int imageAttributes ,pointer callback,pointer callbackData )")
DrawImagePointsRect = Gdiplus.api("GdipDrawImagePointsRect","int(POINTER Graphics,pointer Image,struct  Points,int count,float srcx,float srcy,float srcwidth,float srcheight,int srcUnit,int imageAttributes ,pointer callback,pointer callbackData )")
DrawImagePointsRectI = Gdiplus.api("GdipDrawImagePointsRectI","int(POINTER Graphics,pointer Image,struct  Points,int count,int srcx,int srcy,int srcwidth,int srcheight,int srcUnit,int imageAttributes ,pointer callback,pointer callbackData )")

GetImageDecoders = Gdiplus.api("GdipGetImageDecoders","int(int numDecoders,int size,pointer& decoders)")
GetImageEncodersSize = Gdiplus.api("GdipGetImageEncodersSize","int(int& numEncoders,int& size)")
GetImageEncoders = Gdiplus.api("GdipGetImageEncoders","int(int numEncoders,int size,pointer& encoders)")
Comment = Gdiplus.api("GdipComment","int(POINTER Graphics,int sizeData,pointer& data)")

LoadImageFromFile = Gdiplus.api("GdipLoadImageFromFile","int(string FileName,pointer& Image)")
LoadImageFromFileICM = Gdiplus.api("GdipLoadImageFromFileICM","int(string FileName,pointer& Image)")
LoadImageFromStream = Gdiplus.api("GdipLoadImageFromStream","int(POINTER stream,pointer& Image)")
LoadImageFromStreamICM = Gdiplus.api("GdipLoadImageFromStreamICM","int(POINTER stream,pointer& Image)")
DisposeImage = Gdiplus.api("GdipDisposeImage","int(POINTER Image)")
CloneImage = Gdiplus.api("GdipCloneImage","int(POINTER Image,int& cloneImage)")

SaveImageToFile = Gdiplus.api("GdipSaveImageToFile","int(POINTER Image,string FileName,struct clsidEncoder,struct encoderParams)")
SaveImageToStream = Gdiplus.api("GdipSaveImageToStream","int(POINTER Image,pointer stream,struct& clsidEncoder,pointer& encoderParams)")

SaveAdd = Gdiplus.api("GdipSaveAdd","int(POINTER Image,struct& encoderParams)")
SaveAddImage = Gdiplus.api("GdipSaveAddImage","int(POINTER Image,int newImage,struct& encoderParams)")

GetImageBounds = Gdiplus.api("GdipGetImageBounds","int(POINTER Image,struct& srcRect,struct& srcUnit)")
GetImageDimension = Gdiplus.api("GdipGetImageDimension","int(POINTER Image,float& Width,float& Height)")
GetImageType = Gdiplus.api("GdipGetImageType","int(POINTER Image,struct& itype)")
GetImageWidth = Gdiplus.api("GdipGetImageWidth","int(POINTER Image,int& Width)")
GetImageHeight = Gdiplus.api("GdipGetImageHeight","int(POINTER Image,int& Height)")
GetImageHorizontalResolution = Gdiplus.api("GdipGetImageHorizontalResolution","int(POINTER Image,float& resolution)")
GetImageVerticalResolution = Gdiplus.api("GdipGetImageVerticalResolution","int(POINTER Image,float& resolution)")
GetImageFlags = Gdiplus.api("GdipGetImageFlags","int(POINTER Image,int& flags)")
GetImageRawFormat = Gdiplus.api("GdipGetImageRawFormat","int(POINTER Image,struct& Format)")
GetImagePixelFormat = Gdiplus.api("GdipGetImagePixelFormat","int(POINTER Image,int& PixelFormat)")
GetImageThumbnail = Gdiplus.api("GdipGetImageThumbnail","int(POINTER Image,int thumbWidth,int thumbHeight,int& thumbImage,pointer callback,pointer callbackData )")
GetEncoderParameterListSize = Gdiplus.api("GdipGetEncoderParameterListSize","int(POINTER Image,struct& clsidEncoder,int& size)")
GetEncoderParameterList = Gdiplus.api("GdipGetEncoderParameterList","int(POINTER Image,struct& clsidEncoder,int size,struct& buffer)")

ImageGetFrameDimensionsCount = Gdiplus.api("GdipImageGetFrameDimensionsCount","int(POINTER Image,int& count)")
ImageGetFrameDimensionsList = Gdiplus.api("GdipImageGetFrameDimensionsList","int(POINTER Image,struct& dimensionIDs,int count)")
ImageGetFrameCount = Gdiplus.api("GdipImageGetFrameCount","int(POINTER Image,struct& dimensionID,int& count)")
ImageSelectActiveFrame = Gdiplus.api("GdipImageSelectActiveFrame","int(POINTER Image,struct& dimensionID,int frameIndex)")
ImageRotateFlip = Gdiplus.api("GdipImageRotateFlip","int(POINTER Image,struct rfType)")
GetImagePalette = Gdiplus.api("GdipGetImagePalette","int(POINTER Image,struct& palette,int size)")
SetImagePalette = Gdiplus.api("GdipSetImagePalette","int(POINTER Image,struct& palette)")
GetImagePaletteSize = Gdiplus.api("GdipGetImagePaletteSize","int(POINTER Image,int& size)")
GetPropertyCount = Gdiplus.api("GdipGetPropertyCount","int(POINTER Image,int& numOfProperty)")
GetPropertyIdList = Gdiplus.api("GdipGetPropertyIdList","int(POINTER Image,int numOfProperty,int& list)")
GetPropertyItemSize = Gdiplus.api("GdipGetPropertyItemSize","int(POINTER Image,int propId,int& size)")
GetPropertyItem = Gdiplus.api("GdipGetPropertyItem","int(POINTER Image,int propId,int propSize,struct& buffer)")
GetPropertySize = Gdiplus.api("GdipGetPropertySize","int(POINTER Image,int& totalBufferSize,int& numProperties)")
GetAllPropertyItems = Gdiplus.api("GdipGetAllPropertyItems","int(POINTER Image,int totalBufferSize,int numProperties,struct& allItems)")
RemovePropertyItem = Gdiplus.api("GdipRemovePropertyItem","int(POINTER Image,int propId)")
SetPropertyItem = Gdiplus.api("GdipSetPropertyItem","int(POINTER Image,struct& Item)")
ImageForceValidation = Gdiplus.api("GdipImageForceValidation","int(POINTER Image)")

//==================================================

CreatePen1 = Gdiplus.api("GdipCreatePen1","int(int color,float Width,int unit,pointer& pen)")
CreatePen2 = Gdiplus.api("GdipCreatePen2","int(POINTER Brush,float Width,int unit,pointer& pen)")
ClonePen = Gdiplus.api("GdipClonePen","int(POINTER pen,int& clonepen)")
DeletePen = Gdiplus.api("GdipDeletePen","int(POINTER pen,)")

SetPenWidth = Gdiplus.api("GdipSetPenWidth","int(POINTER pen,float Width)")
GetPenWidth = Gdiplus.api("GdipGetPenWidth","int(POINTER pen,float& Width)")
SetPenUnit = Gdiplus.api("GdipSetPenUnit","int(POINTER pen,int unit)")
GetPenUnit = Gdiplus.api("GdipGetPenUnit","int(POINTER pen,struct& unit)")

::Gdiplus := ..raw.loadDll("Gdiplus")
SetPenLineCap = Gdiplus.api("GdipSetPenLineCap197819","int(POINTER pen,struct startCap,struct endCap,struct dcap)")
SetPenStartCap = Gdiplus.api("GdipSetPenStartCap","int(POINTER pen,struct startCap)")
SetPenEndCap = Gdiplus.api("GdipSetPenEndCap","int(POINTER pen,struct endCap)")
SetPenDashCap = Gdiplus.api("GdipSetPenDashCap197819","int(POINTER pen,struct dcap)")
GetPenStartCap = Gdiplus.api("GdipGetPenStartCap","int(POINTER pen,struct& startCap)")
GetPenEndCap = Gdiplus.api("GdipGetPenEndCap","int(POINTER pen,struct& endCap)")
GetPenDashCap = Gdiplus.api("GdipGetPenDashCap197819","int(POINTER pen,struct& dcap)")
SetPenLineJoin = Gdiplus.api("GdipSetPenLineJoin","int(POINTER pen,struct lnJoin)")
GetPenLineJoin = Gdiplus.api("GdipGetPenLineJoin","int(POINTER pen,struct& lnJoin)")
SetPenCustomStartCap = Gdiplus.api("GdipSetPenCustomStartCap","int(POINTER pen,int customCap)")
GetPenCustomStartCap = Gdiplus.api("GdipGetPenCustomStartCap","int(POINTER pen,int& customCap)")
SetPenCustomEndCap = Gdiplus.api("GdipSetPenCustomEndCap","int(POINTER pen,int customCap)")
GetPenCustomEndCap = Gdiplus.api("GdipGetPenCustomEndCap","int(POINTER pen,int& customCap)")

SetPenMiterLimit = Gdiplus.api("GdipSetPenMiterLimit","int(POINTER pen,float miterLimit)")
GetPenMiterLimit = Gdiplus.api("GdipGetPenMiterLimit","int(POINTER pen,float& miterLimit)")
SetPenMode = Gdiplus.api("GdipSetPenMode","int(POINTER pen,struct penMode)")
GetPenMode = Gdiplus.api("GdipGetPenMode","int(POINTER pen,struct& penMode)")
SetPenTransform = Gdiplus.api("GdipSetPenTransform","int(POINTER pen,int matrix)")
GetPenTransform = Gdiplus.api("GdipGetPenTransform","int(POINTER pen,int matrix)")
ResetPenTransform = Gdiplus.api("GdipResetPenTransform","int(POINTER pen,)")
MultiplyPenTransform = Gdiplus.api("GdipMultiplyPenTransform","int(POINTER pen,int matrix,int order)")
TranslatePenTransform = Gdiplus.api("GdipTranslatePenTransform","int(POINTER pen,float dx,float dy,int order)")
ScalePenTransform = Gdiplus.api("GdipScalePenTransform","int(POINTER pen,float sx,float sy,int order)")
RotatePenTransform = Gdiplus.api("GdipRotatePenTransform","int(POINTER pen,float angle,int order)")
SetPenColor = Gdiplus.api("GdipSetPenColor","int(POINTER pen,int argb)")
GetPenColor = Gdiplus.api("GdipGetPenColor","int(POINTER pen,int& argb)")
SetPenBrushFill = Gdiplus.api("GdipSetPenBrushFill","int(POINTER pen,pointer Brush)")
GetPenBrushFill = Gdiplus.api("GdipGetPenBrushFill","int(POINTER pen,pointer& Brush)")
GetPenFillType = Gdiplus.api("GdipGetPenFillType","int(POINTER pen,struct& ptype)")
GetPenDashStyle = Gdiplus.api("GdipGetPenDashStyle","int(POINTER pen,struct& dStyle)")
SetPenDashStyle = Gdiplus.api("GdipSetPenDashStyle","int(POINTER pen,struct dStyle)")
GetPenDashOffset = Gdiplus.api("GdipGetPenDashOffset","int(POINTER pen,float& Offset)")
SetPenDashOffset = Gdiplus.api("GdipSetPenDashOffset","int(POINTER pen,float Offset)")
GetPenDashCount = Gdiplus.api("GdipGetPenDashCount","int(POINTER pen,int& count)")
SetPenDashArray = Gdiplus.api("GdipSetPenDashArray","int(POINTER pen,float& dash,int count)")
GetPenDashArray = Gdiplus.api("GdipGetPenDashArray","int(POINTER pen,float& dash,int count)")
GetPenCompoundCount = Gdiplus.api("GdipGetPenCompoundCount","int(POINTER pen,int& count)")
SetPenCompoundArray = Gdiplus.api("GdipSetPenCompoundArray","int(POINTER pen,float& dash,int count)")
GetPenCompoundArray = Gdiplus.api("GdipGetPenCompoundArray","int(POINTER pen,float& dash,int count)")

CreateCustomLineCap = Gdiplus.api("GdipCreateCustomLineCap","int(int fillPath,int strokePath,struct baseCap,float baseInset,int& customCap)")
DeleteCustomLineCap = Gdiplus.api("GdipDeleteCustomLineCap","int(int customCap)")
CloneCustomLineCap = Gdiplus.api("GdipCloneCustomLineCap","int(int customCap,int& clonedCap)")
GetCustomLineCapType = Gdiplus.api("GdipGetCustomLineCapType","int(int customCap,struct& capType)")
::Gdiplus := ..raw.loadDll("Gdiplus")
SetCustomLineCapStrokeCaps = Gdiplus.api("GdipSetCustomLineCapStrokeCaps","int(int customCap,struct startCap,struct endCap)")
GetCustomLineCapStrokeCaps = Gdiplus.api("GdipGetCustomLineCapStrokeCaps","int(int customCap,struct& startCap,struct& endCap)")
SetCustomLineCapStrokeJoin = Gdiplus.api("GdipSetCustomLineCapStrokeJoin","int(int customCap,struct lnJoin)")
GetCustomLineCapStrokeJoin = Gdiplus.api("GdipGetCustomLineCapStrokeJoin","int(int customCap,struct& lnJoin)")
SetCustomLineCapBaseCap = Gdiplus.api("GdipSetCustomLineCapBaseCap","int(int customCap,struct baseCap)")
GetCustomLineCapBaseCap = Gdiplus.api("GdipGetCustomLineCapBaseCap","int(int customCap,struct& baseCap)")
SetCustomLineCapBaseInset = Gdiplus.api("GdipSetCustomLineCapBaseInset","int(int customCap,float inset)")
GetCustomLineCapBaseInset = Gdiplus.api("GdipGetCustomLineCapBaseInset","int(int customCap,float& inset)")
SetCustomLineCapWidthScale = Gdiplus.api("GdipSetCustomLineCapWidthScale","int(int customCap,float widthScale)")
GetCustomLineCapWidthScale = Gdiplus.api("GdipGetCustomLineCapWidthScale","int(int customCap,float& widthScale)")

CreateAdjustableArrowCap = Gdiplus.api("GdipCreateAdjustableArrowCap","int(float Height,float Width,int isFilled,int& cap)")
SetAdjustableArrowCapHeight = Gdiplus.api("GdipSetAdjustableArrowCapHeight","int(int cap,float Height)")
GetAdjustableArrowCapHeight = Gdiplus.api("GdipGetAdjustableArrowCapHeight","int(int cap,float& Height)")
SetAdjustableArrowCapWidth = Gdiplus.api("GdipSetAdjustableArrowCapWidth","int(int cap,float Width)")
GetAdjustableArrowCapWidth = Gdiplus.api("GdipGetAdjustableArrowCapWidth","int(int cap,float& Width)")
SetAdjustableArrowCapMiddleInset = Gdiplus.api("GdipSetAdjustableArrowCapMiddleInset","int(int cap,float middleInset)")
GetAdjustableArrowCapMiddleInset = Gdiplus.api("GdipGetAdjustableArrowCapMiddleInset","int(int cap,float& middleInset)")
SetAdjustableArrowCapFillState = Gdiplus.api("GdipSetAdjustableArrowCapFillState","int(int cap,int bFillState)")
GetAdjustableArrowCapFillState = Gdiplus.api("GdipGetAdjustableArrowCapFillState","int(int cap,int& bFillState)")

//==================================================

CreateBitmapFromFile = Gdiplus.api("GdipCreateBitmapFromFile","int(string FileName,pointer& Bitmap)")
CreateBitmapFromFileICM = Gdiplus.api("GdipCreateBitmapFromFileICM","int(string FileName,pointer& Bitmap)")
CreateBitmapFromStream = Gdiplus.api("GdipCreateBitmapFromStream","int(POINTER stream,pointer& Bitmap)")
CreateBitmapFromStreamICM = Gdiplus.api("GdipCreateBitmapFromStreamICM","int(POINTER stream,pointer& Bitmap)")
CreateBitmapFromScan0 = Gdiplus.api("GdipCreateBitmapFromScan0","int(int Width,int Height,int stride,int PixelFormat,pointer& scan0,pointer& Bitmap)")
CreateBitmapFromGraphics = Gdiplus.api("GdipCreateBitmapFromGraphics","int(int Width,int Height,pointer Graphics,pointer& Bitmap)")
CreateBitmapFromGdiDib = Gdiplus.api("GdipCreateBitmapFromGdiDib","int(struct& gdiBitmapInfo,int gdiBitmapData,pointer& Bitmap)")
CreateBitmapFromHBITMAP = Gdiplus.api("GdipCreateBitmapFromHBITMAP","int(POINTER hbm,int hpal,pointer& Bitmap)")
CreateHBITMAPFromBitmap = Gdiplus.api("GdipCreateHBITMAPFromBitmap","int(POINTER Bitmap,int& hbmReturn,int background)")
CreateBitmapFromHICON = Gdiplus.api("GdipCreateBitmapFromHICON","int(POINTER hicon,pointer& Bitmap)")
CreateHICONFromBitmap = Gdiplus.api("GdipCreateHICONFromBitmap","int(POINTER Bitmap,int& hbmReturn)")
CreateBitmapFromResource = Gdiplus.api("GdipCreateBitmapFromResource","int(int hInstance,int lpBitmapName,pointer& Bitmap)")

CloneBitmapArea = Gdiplus.api("GdipCloneBitmapArea","int(float x,float y,float Width,float Height,int PixelFormat,int srcBitmap,int& dstBitmap)")
CloneBitmapAreaI = Gdiplus.api("GdipCloneBitmapAreaI","int(int x,int y,int Width,int Height,int PixelFormat,int srcBitmap,int& dstBitmap)")

BitmapLockBits = Gdiplus.api("GdipBitmapLockBits","int(POINTER Bitmap,struct  rect,int flags,int PixelFormat,struct& lockedBitmapData)")
BitmapUnlockBits = Gdiplus.api("GdipBitmapUnlockBits","int(POINTER Bitmap,struct  lockedBitmapData)")

BitmapGetPixel = Gdiplus.api("GdipBitmapGetPixel","int(POINTER Bitmap,int x,int y,int& color)")
BitmapSetPixel = Gdiplus.api("GdipBitmapSetPixel","int(POINTER Bitmap,int x,int y,int color)")

BitmapSetResolution = Gdiplus.api("GdipBitmapSetResolution","int(POINTER Bitmap,float xdpi,float ydpi)")

CreateCachedBitmap = Gdiplus.api("GdipCreateCachedBitmap","int(POINTER Bitmap,pointer Graphics,int& cachedBitmap)")
DeleteCachedBitmap = Gdiplus.api("GdipDeleteCachedBitmap","int(int cachedBitmap)")
DrawCachedBitmap = Gdiplus.api("GdipDrawCachedBitmap","int(POINTER Graphics,int cachedBitmap,int x,int y)")

//==================================================

CloneBrush = Gdiplus.api("GdipCloneBrush","int(POINTER Brush,int& cloneBrush)")
DeleteBrush = Gdiplus.api("GdipDeleteBrush","int(POINTER Brush)")
GetBrushType = Gdiplus.api("GdipGetBrushType","int(POINTER Brush,struct& brshType)")
CreateHatchBrush = Gdiplus.api("GdipCreateHatchBrush","int(struct style,int forecolr,int backcolr,pointer& Brush)")
GetHatchStyle = Gdiplus.api("GdipGetHatchStyle","int(POINTER Brush,struct& style)")
GetHatchForegroundColor = Gdiplus.api("GdipGetHatchForegroundColor","int(POINTER Brush,int& forecolr)")
GetHatchBackgroundColor = Gdiplus.api("GdipGetHatchBackgroundColor","int(POINTER Brush,int& backcolr)")
CreateSolidFill = Gdiplus.api("GdipCreateSolidFill","int(int argb,pointer& Brush)")
SetSolidFillColor = Gdiplus.api("GdipSetSolidFillColor","int(POINTER Brush,int argb)")
GetSolidFillColor = Gdiplus.api("GdipGetSolidFillColor","int(POINTER Brush,int& argb)")
CreateLineBrush = Gdiplus.api("GdipCreateLineBrush","int(struct  Point1,struct Point2,int color1,int color2,int WrapMd,pointer& lineGradient)")
CreateLineBrushI = Gdiplus.api("GdipCreateLineBrushI","int(struct Point1,struct Point2,int color1,int color2,int WrapMd,pointer& lineGradient)")
CreateLineBrushFromRect = Gdiplus.api("GdipCreateLineBrushFromRect","int(struct  rect,int color1,int color2,int Mode,int WrapMd,pointer& lineGradient)")
CreateLineBrushFromRectI = Gdiplus.api("GdipCreateLineBrushFromRectI","int(struct rect,int color1,int color2,int Mode,int WrapMd,pointer& lineGradient)")
CreateLineBrushFromRectWithAngle = Gdiplus.api("GdipCreateLineBrushFromRectWithAngle","int(struct  rect,int color1,int color2,float angle,int isAngleScalable,int WrapMd,pointer& lineGradient)")
CreateLineBrushFromRectWithAngleI = Gdiplus.api("GdipCreateLineBrushFromRectWithAngleI","int(struct  rect,int color1,int color2,float angle,int isAngleScalable,int WrapMd,pointer& lineGradient)")
SetLineColors = Gdiplus.api("GdipSetLineColors","int(POINTER Brush,int color1,int color2)")
GetLineColors = Gdiplus.api("GdipGetLineColors","int(POINTER Brush,int& lColors)")
GetLineRect = Gdiplus.api("GdipGetLineRect","int(POINTER Brush,struct& rect)")
GetLineRectI = Gdiplus.api("GdipGetLineRectI","int(POINTER Brush,struct& rect)")
SetLineGammaCorrection = Gdiplus.api("GdipSetLineGammaCorrection","int(POINTER Brush,int useGammaCorrection)")
GetLineGammaCorrection = Gdiplus.api("GdipGetLineGammaCorrection","int(POINTER Brush,int& useGammaCorrection)")
GetLineBlendCount = Gdiplus.api("GdipGetLineBlendCount","int(POINTER Brush,int& count)")
GetLineBlend = Gdiplus.api("GdipGetLineBlend","int(POINTER Brush,float& blend,float& positions,int count)")
SetLineBlend = Gdiplus.api("GdipSetLineBlend","int(POINTER Brush,float& blend,float& positions,int count)")
GetLinePresetBlendCount = Gdiplus.api("GdipGetLinePresetBlendCount","int(POINTER Brush,int& count)")
GetLinePresetBlend = Gdiplus.api("GdipGetLinePresetBlend","int(POINTER Brush,int& blend,float& positions,int count)")
SetLinePresetBlend = Gdiplus.api("GdipSetLinePresetBlend","int(POINTER Brush,int& blend,float& positions,int count)")
SetLineSigmaBlend = Gdiplus.api("GdipSetLineSigmaBlend","int(POINTER Brush,float focus,float theScale)")
SetLineLinearBlend = Gdiplus.api("GdipSetLineLinearBlend","int(POINTER Brush,float focus,float theScale)")
SetLineWrapMode = Gdiplus.api("GdipSetLineWrapMode","int(POINTER Brush,int WrapMd)")
GetLineWrapMode = Gdiplus.api("GdipGetLineWrapMode","int(POINTER Brush,struct& WrapMd)")
GetLineTransform = Gdiplus.api("GdipGetLineTransform","int(POINTER Brush,int& matrix)")
SetLineTransform = Gdiplus.api("GdipSetLineTransform","int(POINTER Brush,int matrix)")
ResetLineTransform = Gdiplus.api("GdipResetLineTransform","int(POINTER Brush)")
MultiplyLineTransform = Gdiplus.api("GdipMultiplyLineTransform","int(POINTER Brush,int matrix,int order)")
TranslateLineTransform = Gdiplus.api("GdipTranslateLineTransform","int(POINTER Brush,float dx,float dy,int order)")
ScaleLineTransform = Gdiplus.api("GdipScaleLineTransform","int(POINTER Brush,float sx,float sy,int order)")
RotateLineTransform = Gdiplus.api("GdipRotateLineTransform","int(POINTER Brush,float angle,int order)")
CreateTexture = Gdiplus.api("GdipCreateTexture","int(POINTER Image,int WrapMd,pointer& texture)")
CreateTexture2 = Gdiplus.api("GdipCreateTexture2","int(POINTER Image,int WrapMd,float x,float y,float Width,float Height,pointer& texture)")
CreateTextureIA = Gdiplus.api("GdipCreateTextureIA","int(POINTER Image,int imageAttributes,float x,float y,float Width,float Height,pointer& texture)")
CreateTexture2I = Gdiplus.api("GdipCreateTexture2I","int(POINTER Image,int WrapMd,int x,int y,int Width,int Height,pointer& texture)")
CreateTextureIAI = Gdiplus.api("GdipCreateTextureIAI","int(POINTER Image,int imageAttributes,int x,int y,int Width,int Height,pointer& texture)")
GetTextureTransform = Gdiplus.api("GdipGetTextureTransform","int(POINTER Brush,int matrix)")
SetTextureTransform = Gdiplus.api("GdipSetTextureTransform","int(POINTER Brush,int matrix)")
ResetTextureTransform = Gdiplus.api("GdipResetTextureTransform","int(POINTER Brush)")
TranslateTextureTransform = Gdiplus.api("GdipTranslateTextureTransform","int(POINTER Brush,float dx,float dy,int order)")
MultiplyTextureTransform = Gdiplus.api("GdipMultiplyTextureTransform","int(POINTER Brush,int matrix,int order)")
ScaleTextureTransform = Gdiplus.api("GdipScaleTextureTransform","int(POINTER Brush,float sx,float sy,int order)")
RotateTextureTransform = Gdiplus.api("GdipRotateTextureTransform","int(POINTER Brush,float angle,int order)")
SetTextureWrapMode = Gdiplus.api("GdipSetTextureWrapMode","int(POINTER Brush,int WrapMd)")
GetTextureWrapMode = Gdiplus.api("GdipGetTextureWrapMode","int(POINTER Brush,struct& WrapMd)")
GetTextureImage = Gdiplus.api("GdipGetTextureImage","int(POINTER Brush,pointer& Image)")
CreatePathGradient = Gdiplus.api("GdipCreatePathGradient","int(struct  Points,int count,int WrapMd,pointer& polyGradient)")
CreatePathGradientI = Gdiplus.api("GdipCreatePathGradientI","int(struct  Points,int count,int WrapMd,pointer& polyGradient)")
CreatePathGradientFromPath = Gdiplus.api("GdipCreatePathGradientFromPath","int(POINTER Path,pointer& polyGradient)")
GetPathGradientCenterColor = Gdiplus.api("GdipGetPathGradientCenterColor","int(POINTER Brush,int& lColors)")
SetPathGradientCenterColor = Gdiplus.api("GdipSetPathGradientCenterColor","int(POINTER Brush,int lColors)")
GetPathGradientSurroundColorsWithCount = Gdiplus.api("GdipGetPathGradientSurroundColorsWithCount","int(POINTER Brush,int& argb,int& count)")
SetPathGradientSurroundColorsWithCount = Gdiplus.api("GdipSetPathGradientSurroundColorsWithCount","int(POINTER Brush,int& argb,int& count)")
GetPathGradientPath = Gdiplus.api("GdipGetPathGradientPath","int(POINTER Brush,pointer Path)")
SetPathGradientPath = Gdiplus.api("GdipSetPathGradientPath","int(POINTER Brush,pointer Path)")
GetPathGradientCenterPoint = Gdiplus.api("GdipGetPathGradientCenterPoint","int(POINTER Brush,struct  Points)")
GetPathGradientCenterPointI = Gdiplus.api("GdipGetPathGradientCenterPointI","int(POINTER Brush,struct  Points)")
SetPathGradientCenterPoint = Gdiplus.api("GdipSetPathGradientCenterPoint","int(POINTER Brush,struct  Points)")
SetPathGradientCenterPointI = Gdiplus.api("GdipSetPathGradientCenterPointI","int(POINTER Brush,struct  Points)")
GetPathGradientRect = Gdiplus.api("GdipGetPathGradientRect","int(POINTER Brush,struct& rect)")
GetPathGradientRectI = Gdiplus.api("GdipGetPathGradientRectI","int(POINTER Brush,struct& rect)")
GetPathGradientPointCount = Gdiplus.api("GdipGetPathGradientPointCount","int(POINTER Brush,int& count)")
GetPathGradientSurroundColorCount = Gdiplus.api("GdipGetPathGradientSurroundColorCount","int(POINTER Brush,int& count)")
SetPathGradientGammaCorrection = Gdiplus.api("GdipSetPathGradientGammaCorrection","int(POINTER Brush,int useGammaCorrection)")
GetPathGradientGammaCorrection = Gdiplus.api("GdipGetPathGradientGammaCorrection","int(POINTER Brush,int& useGammaCorrection)")
GetPathGradientBlendCount = Gdiplus.api("GdipGetPathGradientBlendCount","int(POINTER Brush,int& count)")
GetPathGradientBlend = Gdiplus.api("GdipGetPathGradientBlend","int(POINTER Brush,float& blend,float& positions,int count)")
SetPathGradientBlend = Gdiplus.api("GdipSetPathGradientBlend","int(POINTER Brush,float& blend,float& positions,int count)")
GetPathGradientPresetBlendCount = Gdiplus.api("GdipGetPathGradientPresetBlendCount","int(POINTER Brush,int& count)")
GetPathGradientPresetBlend = Gdiplus.api("GdipGetPathGradientPresetBlend","int(POINTER Brush,int& blend,float& positions,int count)")
SetPathGradientPresetBlend = Gdiplus.api("GdipSetPathGradientPresetBlend","int(POINTER Brush,int& blend,float& positions,int count)")
SetPathGradientSigmaBlend = Gdiplus.api("GdipSetPathGradientSigmaBlend","int(POINTER Brush,float focus,float sScale)")
SetPathGradientLinearBlend = Gdiplus.api("GdipSetPathGradientLinearBlend","int(POINTER Brush,float focus,float sScale)")
GetPathGradientWrapMode = Gdiplus.api("GdipGetPathGradientWrapMode","int(POINTER Brush,struct& WrapMd)")
SetPathGradientWrapMode = Gdiplus.api("GdipSetPathGradientWrapMode","int(POINTER Brush,int WrapMd)")
GetPathGradientTransform = Gdiplus.api("GdipGetPathGradientTransform","int(POINTER Brush,int matrix)")
SetPathGradientTransform = Gdiplus.api("GdipSetPathGradientTransform","int(POINTER Brush,int matrix)")
ResetPathGradientTransform = Gdiplus.api("GdipResetPathGradientTransform","int(POINTER Brush)")
MultiplyPathGradientTransform = Gdiplus.api("GdipMultiplyPathGradientTransform","int(POINTER Brush,int matrix,int order)")
TranslatePathGradientTransform = Gdiplus.api("GdipTranslatePathGradientTransform","int(POINTER Brush,float dx,float dy,int order)")
ScalePathGradientTransform = Gdiplus.api("GdipScalePathGradientTransform","int(POINTER Brush,float sx,float sy,int order)")
RotatePathGradientTransform = Gdiplus.api("GdipRotatePathGradientTransform","int(POINTER Brush,float angle,int order)")
GetPathGradientFocusScales = Gdiplus.api("GdipGetPathGradientFocusScales","int(POINTER Brush,float& xScale,float& yScale)")
SetPathGradientFocusScales = Gdiplus.api("GdipSetPathGradientFocusScales","int(POINTER Brush,float xScale,float yScale)")
CreatePath = Gdiplus.api("GdipCreatePath","int(int brushmode,pointer& Path)")
CreatePath2 = Gdiplus.api("GdipCreatePath2","int(struct  Points,pointer& types,int count,struct& brushmode,pointer& Path)")
CreatePath2I = Gdiplus.api("GdipCreatePath2I","int(struct  Points,pointer& types,int count,struct& brushmode,pointer& Path)")
ClonePath = Gdiplus.api("GdipClonePath","int(POINTER Path,int& clonePath)")
DeletePath = Gdiplus.api("GdipDeletePath","int(POINTER Path)")
ResetPath = Gdiplus.api("GdipResetPath","int(POINTER Path)")
GetPointCount = Gdiplus.api("GdipGetPointCount","int(POINTER Path,int& count)")
GetPathTypes = Gdiplus.api("GdipGetPathTypes","int(POINTER Path,pointer& types,int count)")
GetPathPoints = Gdiplus.api("GdipGetPathPoints","int(POINTER Path,struct  Points,int count)")
GetPathPointsI = Gdiplus.api("GdipGetPathPointsI","int(POINTER Path,struct  Points,int count)")
GetPathFillMode = Gdiplus.api("GdipGetPathFillMode","int(POINTER Path,struct brushmode)")
SetPathFillMode = Gdiplus.api("GdipSetPathFillMode","int(POINTER Path,struct brushmode)")
GetPathData = Gdiplus.api("GdipGetPathData","int(POINTER Path,struct& pdata)")
StartPathFigure = Gdiplus.api("GdipStartPathFigure","int(POINTER Path)")
ClosePathFigure = Gdiplus.api("GdipClosePathFigure","int(POINTER Path)")
ClosePathFigures = Gdiplus.api("GdipClosePathFigures","int(POINTER Path)")
SetPathMarker = Gdiplus.api("GdipSetPathMarker","int(POINTER Path)")
ClearPathMarkers = Gdiplus.api("GdipClearPathMarkers","int(POINTER Path)")
ReversePath = Gdiplus.api("GdipReversePath","int(POINTER Path)")
GetPathLastPoint = Gdiplus.api("GdipGetPathLastPoint","int(POINTER Path,struct& lastPoint)")
AddPathLine = Gdiplus.api("GdipAddPathLine","int(POINTER Path,float x1,float y1,float x2,float y2)")
AddPathLine2 = Gdiplus.api("GdipAddPathLine2","int(POINTER Path,struct  Points,int count)")
AddPathArc = Gdiplus.api("GdipAddPathArc","int(POINTER Path,float x,float y,float Width,float Height,float startAngle,float sweepAngle)")
AddPathBezier = Gdiplus.api("GdipAddPathBezier","int(POINTER Path,float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4)")
AddPathBeziers = Gdiplus.api("GdipAddPathBeziers","int(POINTER Path,struct  Points,int count)")
AddPathCurve = Gdiplus.api("GdipAddPathCurve","int(POINTER Path,struct  Points,int count)")
AddPathCurve2 = Gdiplus.api("GdipAddPathCurve2","int(POINTER Path,struct  Points,int count,float tension)")
AddPathCurve3 = Gdiplus.api("GdipAddPathCurve3","int(POINTER Path,struct  Points,int count,int Offset,int numberOfSegments,float tension)")
AddPathClosedCurve = Gdiplus.api("GdipAddPathClosedCurve","int(POINTER Path,struct  Points,int count)")
AddPathClosedCurve2 = Gdiplus.api("GdipAddPathClosedCurve2","int(POINTER Path,struct  Points,int count,float tension)")
AddPathRectangle = Gdiplus.api("GdipAddPathRectangle","int(POINTER Path,float x,float y,float Width,float Height)")
AddPathRectangles = Gdiplus.api("GdipAddPathRectangles","int(POINTER Path,struct& rect,int count)")
AddPathEllipse = Gdiplus.api("GdipAddPathEllipse","int(POINTER Path,float x,float y,float Width,float Height)")
AddPathPie = Gdiplus.api("GdipAddPathPie","int(POINTER Path,float x,float y,float Width,float Height,float startAngle,float sweepAngle)")
AddPathPolygon = Gdiplus.api("GdipAddPathPolygon","int(POINTER Path,struct  Points,int count)")
AddPathPath = Gdiplus.api("GdipAddPathPath","int(POINTER Path,int addingPath,int bConnect)")
AddPathString = Gdiplus.api("GdipAddPathString","int(POINTER Path,string str,int Length,pointer family,int style,float emSize,struct& layoutRect,pointer StringFormat)")
AddPathStringI = Gdiplus.api("GdipAddPathStringI","int(POINTER Path,string str,int Length,pointer family,int style,float emSize,struct& layoutRect,pointer StringFormat)")
AddPathLineI = Gdiplus.api("GdipAddPathLineI","int(POINTER Path,int x1,int y1,int x2,int y2)")
AddPathLine2I = Gdiplus.api("GdipAddPathLine2I","int(POINTER Path,struct  Points,int count)")
AddPathArcI = Gdiplus.api("GdipAddPathArcI","int(POINTER Path,int x,int y,int Width,int Height,float startAngle,float sweepAngle)")
AddPathBezierI = Gdiplus.api("GdipAddPathBezierI","int(POINTER Path,int x1,int y1,int x2,int y2,int x3,int y3,int x4,int y4)")
AddPathBeziersI = Gdiplus.api("GdipAddPathBeziersI","int(POINTER Path,struct  Points,int count)")
AddPathCurveI = Gdiplus.api("GdipAddPathCurveI","int(POINTER Path,struct  Points,int count)")
AddPathCurve2I = Gdiplus.api("GdipAddPathCurve2I","int(POINTER Path,struct  Points,int count,int tension)")
AddPathCurve3I = Gdiplus.api("GdipAddPathCurve3I","int(POINTER Path,struct  Points,int count,int Offset,int numberOfSegments,float tension)")
AddPathClosedCurveI = Gdiplus.api("GdipAddPathClosedCurveI","int(POINTER Path,struct  Points,int count)")
AddPathClosedCurve2I = Gdiplus.api("GdipAddPathClosedCurve2I","int(POINTER Path,struct  Points,int count,float tension)")
AddPathRectangleI = Gdiplus.api("GdipAddPathRectangleI","int(POINTER Path,int x,int y,int Width,int Height)")
AddPathRectanglesI = Gdiplus.api("GdipAddPathRectanglesI","int(POINTER Path,struct& rects,int count)")
AddPathEllipseI = Gdiplus.api("GdipAddPathEllipseI","int(POINTER Path,int x,int y,int Width,int Height)")
AddPathPieI = Gdiplus.api("GdipAddPathPieI","int(POINTER Path,int x,int y,int Width,int Height,float startAngle,float sweepAngle)")
AddPathPolygonI = Gdiplus.api("GdipAddPathPolygonI","int(POINTER Path,struct  Points,int count)")
FlattenPath = Gdiplus.api("GdipFlattenPath","int(POINTER Path,int matrix = 0,float flatness = 0.25)")
WindingModeOutline = Gdiplus.api("GdipWindingModeOutline","int(POINTER Path,int matrix,float flatness)")
WidenPath = Gdiplus.api("GdipWidenPath","int(int NativePath,pointer pen,int matrix,float flatness)")
WarpPath = Gdiplus.api("GdipWarpPath","int(POINTER Path,int matrix,struct  Points,int count,float srcx,float srcy,float srcwidth,float srcheight,struct WarpMd,float flatness)")
TransformPath = Gdiplus.api("GdipTransformPath","int(POINTER Path,int matrix)")
GetPathWorldBounds = Gdiplus.api("GdipGetPathWorldBounds","int(POINTER Path,struct& bounds,int matrix,pointer pen,)")
GetPathWorldBoundsI = Gdiplus.api("GdipGetPathWorldBoundsI","int(POINTER Path,struct& bounds,int matrix,pointer pen,)")
IsVisiblePathPoint = Gdiplus.api("GdipIsVisiblePathPoint","int(POINTER Path,float x,float y,pointer Graphics,int& result)")
IsVisiblePathPointI = Gdiplus.api("GdipIsVisiblePathPointI","int(POINTER Path,int x,int y,pointer Graphics,int& result)")
IsOutlineVisiblePathPoint = Gdiplus.api("GdipIsOutlineVisiblePathPoint","int(POINTER Path,float x,float y,pointer pen,pointer Graphics,int& result)")
IsOutlineVisiblePathPointI = Gdiplus.api("GdipIsOutlineVisiblePathPointI","int(POINTER Path,int x,int y,pointer pen,pointer Graphics,int& result)")
CreatePathIter = Gdiplus.api("GdipCreatePathIter","int(int& iterator,pointer Path)")
DeletePathIter = Gdiplus.api("GdipDeletePathIter","int(int iterator)")
PathIterNextSubpath = Gdiplus.api("GdipPathIterNextSubpath","int(int iterator,int& resultCount,int& startIndex,int& endIndex,int& isClosed)")
PathIterNextSubpathPath = Gdiplus.api("GdipPathIterNextSubpathPath","int(int iterator,int& resultCount,pointer Path,int& isClosed)")
PathIterNextPathType = Gdiplus.api("GdipPathIterNextPathType","int(int iterator,int& resultCount,pointer& pathType,int& startIndex,int& endIndex)")
PathIterNextMarker = Gdiplus.api("GdipPathIterNextMarker","int(int iterator,int& resultCount,int& startIndex,int& endIndex)")
PathIterNextMarkerPath = Gdiplus.api("GdipPathIterNextMarkerPath","int(int iterator,int& resultCount,pointer Path)")
PathIterGetCount = Gdiplus.api("GdipPathIterGetCount","int(int iterator,int& count)")
PathIterGetSubpathCount = Gdiplus.api("GdipPathIterGetSubpathCount","int(int iterator,int& count)")
PathIterIsValid = Gdiplus.api("GdipPathIterIsValid","int(int iterator,int& valid)")
PathIterHasCurve = Gdiplus.api("GdipPathIterHasCurve","int(int iterator,int& hasCurve)")
PathIterRewind = Gdiplus.api("GdipPathIterRewind","int(int iterator)")
PathIterEnumerate = Gdiplus.api("GdipPathIterEnumerate","int(int iterator,int& resultCount,struct  Points,pointer& types,int count)")
PathIterCopyData = Gdiplus.api("GdipPathIterCopyData","int(int iterator,int& resultCount,struct  Points,pointer& types,int startIndex,int endIndex)")
CreateMatrix = Gdiplus.api("GdipCreateMatrix","int(int& matrix)")
CreateMatrix2 = Gdiplus.api("GdipCreateMatrix2","int(float m11,float m12,float m21,float m22,float dx,float dy,int& matrix)")
CreateMatrix3 = Gdiplus.api("GdipCreateMatrix3","int(struct& rect,struct& dstplg,int& matrix)")
CreateMatrix3I = Gdiplus.api("GdipCreateMatrix3I","int(struct& rect,struct& dstplg,int& matrix)")
CloneMatrix = Gdiplus.api("GdipCloneMatrix","int(int matrix,int& cloneMatrix)")
DeleteMatrix = Gdiplus.api("GdipDeleteMatrix","int(int matrix)")
SetMatrixElements = Gdiplus.api("GdipSetMatrixElements","int(int matrix,float m11,float m12,float m21,float m22,float dx,float dy)")
MultiplyMatrix = Gdiplus.api("GdipMultiplyMatrix","int(int matrix,int matrix2,int order)")
TranslateMatrix = Gdiplus.api("GdipTranslateMatrix","int(int matrix,float offsetX,float offsetY,int order)")
ScaleMatrix = Gdiplus.api("GdipScaleMatrix","int(int matrix,float scaleX,float scaleY,int order)")
RotateMatrix = Gdiplus.api("GdipRotateMatrix","int(int matrix,float angle,int order)")
ShearMatrix = Gdiplus.api("GdipShearMatrix","int(int matrix,float shearX,float shearY,int order)")
InvertMatrix = Gdiplus.api("GdipInvertMatrix","int(int matrix)")
TransformMatrixPoints = Gdiplus.api("GdipTransformMatrixPoints","int(int matrix,struct& pts,int count)")
TransformMatrixPointsI = Gdiplus.api("GdipTransformMatrixPointsI","int(int matrix,struct& pts,int count)")
VectorTransformMatrixPoints = Gdiplus.api("GdipVectorTransformMatrixPoints","int(int matrix,struct& pts,int count)")
VectorTransformMatrixPointsI = Gdiplus.api("GdipVectorTransformMatrixPointsI","int(int matrix,struct& pts,int count)")
GetMatrixElements = Gdiplus.api("GdipGetMatrixElements","int(int matrix,float& matrixOut)")
IsMatrixInvertible = Gdiplus.api("GdipIsMatrixInvertible","int(int matrix,int& result)")
IsMatrixIdentity = Gdiplus.api("GdipIsMatrixIdentity","int(int matrix,int& result)")
IsMatrixEqual = Gdiplus.api("GdipIsMatrixEqual","int(int matrix,int matrix2,int& result)")
CreateRegion = Gdiplus.api("GdipCreateRegion","int(int& region)")
CreateRegionRect = Gdiplus.api("GdipCreateRegionRect","int(struct& rect,int& region)")
CreateRegionRectI = Gdiplus.api("GdipCreateRegionRectI","int(struct& rect,int& region)")
CreateRegionPath = Gdiplus.api("GdipCreateRegionPath","int(POINTER Path,int& region)")

CreateRegionPath = Gdiplus.api("GdipCreateRegionPath","int(POINTER Path,int& region)")
CreateRegionRgnData = Gdiplus.api("GdipCreateRegionRgnData","int(pointer& regionData,int size,int& region)")
CreateRegionHrgn = Gdiplus.api("GdipCreateRegionHrgn","int(int hRgn,int& region)")
CloneRegion = Gdiplus.api("GdipCloneRegion","int(int region,int& cloneRegion)")
DeleteRegion = Gdiplus.api("GdipDeleteRegion","int(int region)")
SetInfinite = Gdiplus.api("GdipSetInfinite","int(int region)")
SetEmpty = Gdiplus.api("GdipSetEmpty","int(int region)")
CombineRegionRect = Gdiplus.api("GdipCombineRegionRect","int(int region,struct& rect,int CombineMd)")
CombineRegionRectI = Gdiplus.api("GdipCombineRegionRectI","int(int region,struct& rect,int CombineMd)")
CombineRegionPath = Gdiplus.api("GdipCombineRegionPath","int(int region,pointer Path,int CombineMd)")
CombineRegionRegion = Gdiplus.api("GdipCombineRegionRegion","int(int region,int region2,int CombineMd)")
TranslateRegion = Gdiplus.api("GdipTranslateRegion","int(int region,float dx,float dy)")
TranslateRegionI = Gdiplus.api("GdipTranslateRegionI","int(int region,int dx,int dy)")
TransformRegion = Gdiplus.api("GdipTransformRegion","int(int region,int matrix)")
GetRegionBounds = Gdiplus.api("GdipGetRegionBounds","int(int region,pointer Graphics,struct& rect)")
GetRegionBoundsI = Gdiplus.api("GdipGetRegionBoundsI","int(int region,pointer Graphics,struct& rect)")
GetRegionHRgn = Gdiplus.api("GdipGetRegionHRgn","int(int region,pointer Graphics,int& hRgn)")
IsEmptyRegion = Gdiplus.api("GdipIsEmptyRegion","int(int region,pointer Graphics,int& result)")
IsInfiniteRegion = Gdiplus.api("GdipIsInfiniteRegion","int(int region,pointer Graphics,int& result)")
IsEqualRegion = Gdiplus.api("GdipIsEqualRegion","int(int region,int region2,pointer Graphics,int& result)")
GetRegionDataSize = Gdiplus.api("GdipGetRegionDataSize","int(int region,int& bufferSize)")
GetRegionData = Gdiplus.api("GdipGetRegionData","int(int region,pointer& buffer,int bufferSize,int& sizeFilled)")
IsVisibleRegionPoint = Gdiplus.api("GdipIsVisibleRegionPoint","int(int region,float x,float y,pointer Graphics,int& result)")
IsVisibleRegionPointI = Gdiplus.api("GdipIsVisibleRegionPointI","int(int region,int x,int y,pointer Graphics,int& result)")
IsVisibleRegionRect = Gdiplus.api("GdipIsVisibleRegionRect","int(int region,float x,float y,float Width,float Height,pointer Graphics,int& result)")
IsVisibleRegionRectI = Gdiplus.api("GdipIsVisibleRegionRectI","int(int region,int x,int y,int Width,int Height,pointer Graphics,int& result)")
GetRegionScansCount = Gdiplus.api("GdipGetRegionScansCount","int(int region,int& Ucount,int matrix)")
GetRegionScans = Gdiplus.api("GdipGetRegionScans","int(int region,struct& rects,int& count,int matrix)")
GetRegionScansI = Gdiplus.api("GdipGetRegionScansI","int(int region,struct& rects,int& count,int matrix)")
CreateImageAttributes = Gdiplus.api("GdipCreateImageAttributes","int(pointer& imageattr)")
CloneImageAttributes = Gdiplus.api("GdipCloneImageAttributes","int(POINTER imageattr,pointer& cloneImageattr)")
DisposeImageAttributes = Gdiplus.api("GdipDisposeImageAttributes","int(POINTER imageattr)")
SetImageAttributesToIdentity = Gdiplus.api("GdipSetImageAttributesToIdentity","int(POINTER imageattr,int ClrAdjType)")
ResetImageAttributes = Gdiplus.api("GdipResetImageAttributes","int(POINTER imageattr,int ClrAdjType)")
SetImageAttributesColorMatrix = Gdiplus.api("GdipSetImageAttributesColorMatrix","int(POINTER imageattr,int ClrAdjType,int enableFlag,pointer& colourMatrix,pointer& grayMatrix,int flags)")
SetImageAttributesThreshold = Gdiplus.api("GdipSetImageAttributesThreshold","int(POINTER imageattr,int ClrAdjType,int enableFlag,float threshold)")
SetImageAttributesGamma = Gdiplus.api("GdipSetImageAttributesGamma","int(POINTER imageattr,int ClrAdjType,int enableFlag,float gamma)")
SetImageAttributesNoOp = Gdiplus.api("GdipSetImageAttributesNoOp","int(POINTER imageattr,int ClrAdjType,int enableFlag)")
SetImageAttributesColorKeys = Gdiplus.api("GdipSetImageAttributesColorKeys","int(POINTER imageattr,int ClrAdjType,int enableFlag,int colorLow,int colorHigh)")
SetImageAttributesOutputChannel = Gdiplus.api("GdipSetImageAttributesOutputChannel","int(POINTER imageattr,int ClrAdjstType,int enableFlag,int channelFlags)")
SetImageAttributesOutputChannelColorProfile = Gdiplus.api("GdipSetImageAttributesOutputChannelColorProfile","int(POINTER imageattr,int ClrAdjType,int enableFlag,pointer colorProfileFilename)")
SetImageAttributesRemapTable = Gdiplus.api("GdipSetImageAttributesRemapTable","int(POINTER imageattr,int ClrAdjType,int enableFlag,int mapSize,pointer& map)")
SetImageAttributesWrapMode = Gdiplus.api("GdipSetImageAttributesWrapMode","int(POINTER imageattr,int wrap,int argb,int bClamp)")
//GdipSetImageAttributesICMMode = Gdiplus.api("GdipSetImageAttributesICMMode","int(int imageattr,int bOn)")
GetImageAttributesAdjustedPalette = Gdiplus.api("GdipGetImageAttributesAdjustedPalette","int(POINTER imageattr,struct& colorPal,int ClrAdjType)")
CreateFontFamilyFromName = Gdiplus.api("GdipCreateFontFamilyFromName","int(string name,int fontCollection,pointer& fontFamily)")
DeleteFontFamily = Gdiplus.api("GdipDeleteFontFamily","int(POINTER fontFamily)")
CloneFontFamily = Gdiplus.api("GdipCloneFontFamily","int(POINTER fontFamily,int& clonedFontFamily)")
GetGenericFontFamilySansSerif = Gdiplus.api("GdipGetGenericFontFamilySansSerif","int(int& nativeFamily)")
GetGenericFontFamilySerif = Gdiplus.api("GdipGetGenericFontFamilySerif","int(int& nativeFamily)")
GetGenericFontFamilyMonospace = Gdiplus.api("GdipGetGenericFontFamilyMonospace","int(int& nativeFamily)")
GetFamilyName = Gdiplus.api("GdipGetFamilyName","int(POINTER family,int name,word language)")
IsStyleAvailable = Gdiplus.api("GdipIsStyleAvailable","int(POINTER family,int style,int& IsStyleAvailable)")
// GdipFontCollectionEnumerable = Gdiplus.api("GdipFontCollectionEnumerable","int(int fontCollection,pointer Graphics,int& numFound)")
//GdipFontCollectionEnumerate = Gdiplus.api("GdipFontCollectionEnumerate","int(int fontCollection,int numSought,int& gpFamilies,int numFound,pointer Graphics)")
GetEmHeight = Gdiplus.api("GdipGetEmHeight","int(POINTER family,int style,word& EmHeight)")
GetCellAscent = Gdiplus.api("GdipGetCellAscent","int(POINTER family,int style,word& CellAscent)")
GetCellDescent = Gdiplus.api("GdipGetCellDescent","int(POINTER family,int style,word& CellDescent)")
GetLineSpacing = Gdiplus.api("GdipGetLineSpacing","int(POINTER family,int style,word& LineSpacing)")
CreateFontFromDC = Gdiplus.api("GdipCreateFontFromDC","int(POINTER hDc,pointer& createdfont)")
CreateFontFromLogfontA = Gdiplus.api("GdipCreateFontFromLogfontA","int(POINTER hDc,struct& logfont,pointer& createdfont)")
CreateFontFromLogfontW = Gdiplus.api("GdipCreateFontFromLogfontW","int(POINTER hDc,struct& logfont,pointer& createdfont)")
CreateFont = Gdiplus.api("GdipCreateFont","int(POINTER fontFamily,float emSize,int style,int unit,pointer& createdfont)")
CloneFont = Gdiplus.api("GdipCloneFont","int(POINTER curFont,int& cloneFont)")
DeleteFont = Gdiplus.api("GdipDeleteFont","int(POINTER curFont)")
GetFamily = Gdiplus.api("GdipGetFamily","int(POINTER curFont,int& family)")
GetFontStyle = Gdiplus.api("GdipGetFontStyle","int(POINTER curFont,int& style)")
GetFontSize = Gdiplus.api("GdipGetFontSize","int(POINTER curFont,float& size)")
GetFontUnit = Gdiplus.api("GdipGetFontUnit","int(POINTER curFont,struct& unit)")
GetFontHeight = Gdiplus.api("GdipGetFontHeight","int(POINTER curFont,pointer Graphics,float& Height)")
GetFontHeightGivenDPI = Gdiplus.api("GdipGetFontHeightGivenDPI","int(POINTER curFont,float dpi,float& Height)")
GetLogFontA = Gdiplus.api("GdipGetLogFontA","int(POINTER curFont,pointer Graphics,struct& logfont)")
GetLogFontW = Gdiplus.api("GdipGetLogFontW","int(POINTER curFont,pointer Graphics,struct& logfont)")
NewInstalledFontCollection = Gdiplus.api("GdipNewInstalledFontCollection","int(int& fontCollection)")
NewPrivateFontCollection = Gdiplus.api("GdipNewPrivateFontCollection","int(int& fontCollection)")
DeletePrivateFontCollection = Gdiplus.api("GdipDeletePrivateFontCollection","int(int& fontCollection)")
GetFontCollectionFamilyCount = Gdiplus.api("GdipGetFontCollectionFamilyCount","int(int fontCollection,int& numFound)")
GetFontCollectionFamilyList = Gdiplus.api("GdipGetFontCollectionFamilyList","int(int fontCollection,int numSought,int& gpFamilies,int& numFound)")
PrivateAddFontFile = Gdiplus.api("GdipPrivateAddFontFile","int(int fontCollection,string FileName)")
PrivateAddMemoryFont = Gdiplus.api("GdipPrivateAddMemoryFont","int(int fontCollection,int memory,int Length)")
DrawString = Gdiplus.api("GdipDrawString","int(POINTER Graphics,string str,int Length,pointer thefont,struct& layoutRect,pointer StringFormat,pointer Brush)")
MeasureString = Gdiplus.api("GdipMeasureString","int(POINTER Graphics,string str,int Length,pointer thefont,struct& layoutRect,pointer StringFormat,struct& boundingBox,int& codepointsFitted,int& linesFilled)")
MeasureCharacterRanges = Gdiplus.api("GdipMeasureCharacterRanges","int(POINTER Graphics,string str,int Length,pointer thefont,struct& layoutRect,pointer StringFormat,int regionCount,int& regions)")
DrawDriverString = Gdiplus.api("GdipDrawDriverString","int(POINTER Graphics,string str,int Length,pointer thefont,pointer Brush,struct& positions,int flags,int matrix)")
MeasureDriverString = Gdiplus.api("GdipMeasureDriverString","int(POINTER Graphics,string str,int Length,pointer thefont,struct& positions,int flags,int matrix,struct& boundingBox)")
CreateStringFormat = Gdiplus.api("GdipCreateStringFormat","int(int formatAttributes,word language,pointer& StringFormat)")
StringFormatGetGenericDefault = Gdiplus.api("GdipStringFormatGetGenericDefault","int(pointer& StringFormat)")
StringFormatGetGenericTypographic = Gdiplus.api("GdipStringFormatGetGenericTypographic","int(pointer& StringFormat)")
DeleteStringFormat = Gdiplus.api("GdipDeleteStringFormat","int(POINTER StringFormat)")
CloneStringFormat = Gdiplus.api("GdipCloneStringFormat","int(POINTER StringFormat,int& newFormat)")
SetStringFormatFlags = Gdiplus.api("GdipSetStringFormatFlags","int(POINTER StringFormat,int flags)")
GetStringFormatFlags = Gdiplus.api("GdipGetStringFormatFlags","int(POINTER StringFormat,int& flags)")
SetStringFormatAlign = Gdiplus.api("GdipSetStringFormatAlign","int(POINTER StringFormat,int align)")
GetStringFormatAlign = Gdiplus.api("GdipGetStringFormatAlign","int(POINTER StringFormat,int& align)")
SetStringFormatLineAlign = Gdiplus.api("GdipSetStringFormatLineAlign","int(POINTER StringFormat,int align)")
GetStringFormatLineAlign = Gdiplus.api("GdipGetStringFormatLineAlign","int(POINTER StringFormat,int& align)")
SetStringFormatTrimming = Gdiplus.api("GdipSetStringFormatTrimming","int(POINTER StringFormat,struct trimming)")
GetStringFormatTrimming = Gdiplus.api("GdipGetStringFormatTrimming","int(POINTER StringFormat,int& trimming)")
SetStringFormatHotkeyPrefix = Gdiplus.api("GdipSetStringFormatHotkeyPrefix","int(POINTER StringFormat,struct hkPrefix)")
GetStringFormatHotkeyPrefix = Gdiplus.api("GdipGetStringFormatHotkeyPrefix","int(POINTER StringFormat,struct& hkPrefix)")
SetStringFormatTabStops = Gdiplus.api("GdipSetStringFormatTabStops","int(POINTER StringFormat,float firstTabOffset,int count,float& tabStops)")
GetStringFormatTabStops = Gdiplus.api("GdipGetStringFormatTabStops","int(POINTER StringFormat,int count,float& firstTabOffset,float& tabStops)")
GetStringFormatTabStopCount = Gdiplus.api("GdipGetStringFormatTabStopCount","int(POINTER StringFormat,int& count)")
SetStringFormatDigitSubstitution = Gdiplus.api("GdipSetStringFormatDigitSubstitution","int(POINTER StringFormat,word language,struct substitute)")
GetStringFormatDigitSubstitution = Gdiplus.api("GdipGetStringFormatDigitSubstitution","int(POINTER StringFormat,word& language,struct& substitute)")
GetStringFormatMeasurableCharacterRangeCount = Gdiplus.api("GdipGetStringFormatMeasurableCharacterRangeCount","int(POINTER StringFormat,int& count)")
SetStringFormatMeasurableCharacterRanges = Gdiplus.api("GdipSetStringFormatMeasurableCharacterRanges","int(POINTER StringFormat,int rangeCount,struct& ranges)")
/*end intellisense*/

 
/*
 *=================================
 * 以上为使用频率较高的API 
 *=================================
 */
 
//Image
ImageCodecInfo= class{ 
struct ClassID = win.guid(); 
struct FormatID = win.guid(); 
string CodecName; 
string DllName; 
string FormatDescription; 
string FilenameExtension; 
string MimeType; 
struct flags; 
INT Version; 
INT SigCount; 
INT SigSize; 
pointer SigPattern; 
pointer SigMask;

}

//=================================
//Colors
ColorPalette= class{ 
INT flags; 
int count; 
int Entries[255]
}

//=================================
//Meta File
PWMFRect16= class{ 
word Left; 
word Top; 
word Right; 
word Bottom;

}
var PWMFRect16 = PWMFRect16;

WmfPlaceableFileHeader= class{ 
int Key; // GDIP_WMF_PLACEABLEKEY
word Hmf;  // Metafile pointer number (always 0)
struct boundingBox =PWMFRect16();  // Coordinates in metafile units
word Inch; // Number of metafile units per inch
int Reserved;  // Reserved (always 0)
word Checksum; // Checksum value for previous 10 WORDs
}

ENHMETAHEADER3= class{ 
int itype;   // Record type EMR_HEADER
int nSize;  // Record size in bytes.  This may be greater     // than the sizeof(ENHMETAHEADER).
struct rclBounds = RECTL(); // Inclusive-inclusive bounds in device units
struct rclFrame= RECTL(); // Inclusive-inclusive Picture Frame .01mm unit
int dSignature; // Signature.  Must be ENHMETA_SIGNATURE.
int nVersion; // Version number
int nBytes; // Size of the metafile in bytes
int nRecords; // Number of records in the metafile
word nHandles; // Number of handles in the handle table
                       // Handle index zero is reserved.
word sReserved;  // Reserved.  Must be zero.
int nDescription;  // Number of chars in the unicode desc string  // This is 0 if there is no description string
int offDescription; // Offset to the metafile description record. // This is 0 if there is no description string
int nPalEntries;  // Number of entries in the metafile palette.
struct szlDevice=SIZEL();  // Size of the reference device in pels
struct szlMillimeters=SIZEL();
// Size of the reference device in millimeters
}
var ENHMETAHEADER3 = ENHMETAHEADER3;

METAHEADER= class{ 
word mtType; 
word mtHeaderSize; 
word mtVersion; 
int mtSize; 
word mtNoObjects; 
int mtMaxRecord; 
word mtNoParameters;

}
var METAHEADER = METAHEADER;

MetafileHeader= class{ 
int mType; 
int size;  // Size of the metafile (in bytes)
int Version;  // EMF+, EMF, or WMF version
int EmfPlusFlags; 
float DpiX; 
float DpiY; 
int x;           // Bounds in device units
int y; 
int Width; 
int Height; 
union EmfHeader =
{
struct WmfHeader=METAHEADER();
struct EmfHeader=ENHMETAHEADER3();
}

// NOTE: You//ll have to use CopyMemory to view the METAHEADER type
int EmfPlusHeaderSize;
// size of the EMF+ header in file
int LogicalDpiX;   // Logical Dpi of reference Hdc
int LogicalDpiY;  // usually valid only for EMF+
}

//=================================
//Other
PropertyItem= class{ 
int propId; // ID of this property
int Length;  // Length of the property value, in bytes
word type; // Type of the value, as one of TAG_TYPE_XXX   // defined above
int value;  // property value
}

CharacterRange= class{ 
int First; 
int Length; 
}

//=================================
//== Enums                       ==
//================================= 
//Image
GpImageSaveFormat={ 
GpSaveBMP = 0;
GpSaveJPEG = 1;
GpSaveGIF = 2;
GpSavePNG = 3;
GpSaveTIFF = 4;
}

GpImageFormatIdentifiers={ 
GpImageFormatUndefined = 0;
GpImageFormatMemoryBMP = 1;
GpImageFormatBMP = 2;
GpImageFormatEMF = 3;
GpImageFormatWMF = 4;
GpImageFormatJPEG = 5;
GpImageFormatPNG = 6;
GpImageFormatGIF = 7;
GpImageFormatTIFF = 8;
GpImageFormatEXIF = 9;
GpImageFormatIcon = 10;
}

Image_Type={ 
ImageTypeUnknown = 0;
ImageTypeBitmap = 1;
ImageTypeMetafile = 2;
}

Image_Property_Types={ 
PropertyTagTypeByte = 1;
PropertyTagTypeASCII = 2;
PropertyTagTypeShort = 3;
PropertyTagTypeLong = 4;
PropertyTagTypeRational = 5;
PropertyTagTypeUndefined = 7;
PropertyTagTypeSLONG = 9;
PropertyTagTypeSRational = 10;
}

ImageCodecFlags={ 
ImageCodecFlagsEncoder = 0x1;
ImageCodecFlagsDecoder = 0x2;
ImageCodecFlagsSupportBitmap = 0x4;
ImageCodecFlagsSupportVector = 0x8;
ImageCodecFlagsSeekableEncode = 0x10;
ImageCodecFlagsBlockingDecode = 0x20; 
ImageCodecFlagsBuiltin = 0x10000;
ImageCodecFlagsSystem = 0x20000;
ImageCodecFlagsUser = 0x40000;
}

Image_Property_ID_Tags={ 
PropertyTagExifIFD = 0x8769;
PropertyTagGpsIFD = 0x8825; 
PropertyTagNewSubfileType = 0xFE;
PropertyTagSubfileType = 0xFF;
PropertyTagImageWidth = 0x100;
PropertyTagImageHeight = 0x101;
PropertyTagBitsPerSample = 0x102;
PropertyTagCompression = 0x103;
PropertyTagPhotometricInterp = 0x106;
PropertyTagThreshHolding = 0x107;
PropertyTagCellWidth = 0x108;
PropertyTagCellHeight = 0x109;
PropertyTagFillOrder = 0x10A;
PropertyTagDocumentName = 0x10D;
PropertyTagImageDescription = 0x10E;
PropertyTagEquipMake = 0x10F;
PropertyTagEquipModel = 0x110;
PropertyTagStripOffsets = 0x111;
PropertyTagOrientation = 0x112;
PropertyTagSamplesPerPixel = 0x115;
PropertyTagRowsPerStrip = 0x116;
PropertyTagStripBytesCount = 0x117;
PropertyTagMinSampleValue = 0x118;
PropertyTagMaxSampleValue = 0x119;
PropertyTagXResolution = 0x11A;            // Image resolution in width direction;
PropertyTagYResolution = 0x11B;            // Image resolution in height direction;
PropertyTagPlanarConfig = 0x11C;           // Image data arrangement;
PropertyTagPageName = 0x11D;
PropertyTagXPosition = 0x11E;
PropertyTagYPosition = 0x11F;
PropertyTagFreeOffset = 0x120;
PropertyTagFreeByteCounts = 0x121;
PropertyTagGrayResponseUnit = 0x122;
PropertyTagGrayResponseCurve = 0x123;
PropertyTagT4Option = 0x124;
PropertyTagT6Option = 0x125;
PropertyTagResolutionUnit = 0x128;         // Unit of X and Y resolution;
PropertyTagPageNumber = 0x129;
PropertyTagTransferFuncition = 0x12D;
PropertyTagSoftwareUsed = 0x131;
PropertyTagDateTime = 0x132;
PropertyTagArtist = 0x13B;
PropertyTagHostComputer = 0x13C;
PropertyTagPredictor = 0x13D;
PropertyTagWhitePoint = 0x13E;
PropertyTagPrimaryChromaticities = 0x13F;
PropertyTagColorMap = 0x140;
PropertyTagHalftoneHints = 0x141;
PropertyTagTileWidth = 0x142;
PropertyTagTileLength = 0x143;
PropertyTagTileOffset = 0x144;
PropertyTagTileByteCounts = 0x145;
PropertyTagInkSet = 0x14C;
PropertyTagInkNames = 0x14D;
PropertyTagNumberOfInks = 0x14E;
PropertyTagDotRange = 0x150;
PropertyTagTargetPrinter = 0x151;
PropertyTagExtraSamples = 0x152;
PropertyTagSampleFormat = 0x153;
PropertyTagSMinSampleValue = 0x154;
PropertyTagSMaxSampleValue = 0x155;
PropertyTagTransferRange = 0x156; 
PropertyTagJPEGProc = 0x200;
PropertyTagJPEGInterFormat = 0x201;
PropertyTagJPEGInterLength = 0x202;
PropertyTagJPEGRestartInterval = 0x203;
PropertyTagJPEGLosslessPredictors = 0x205;
PropertyTagJPEGPointTransforms = 0x206;
PropertyTagJPEGQTables = 0x207;
PropertyTagJPEGDCTables = 0x208;
PropertyTagJPEGACTables = 0x209; 
PropertyTagYCbCrCoefficients = 0x211;
PropertyTagYCbCrSubsampling = 0x212;
PropertyTagYCbCrPositioning = 0x213;
PropertyTagREFBlackWhite = 0x214; 
PropertyTagICCProfile = 0x8773;            // This TAG is defined by ICC; // for embedded ICC in TIFF;
PropertyTagGamma = 0x301;
PropertyTagICCProfileDescriptor = 0x302;
PropertyTagSRGBRenderingIntent = 0x303; 
PropertyTagImageTitle = 0x320;
PropertyTagCopyright = 0x8298; 
PropertyTagResolutionXUnit = 0x5001;
PropertyTagResolutionYUnit = 0x5002;
PropertyTagResolutionXLengthUnit = 0x5003;
PropertyTagResolutionYLengthUnit = 0x5004;
PropertyTagPrintFlags = 0x5005;
PropertyTagPrintFlagsVersion = 0x5006;
PropertyTagPrintFlagsCrop = 0x5007;
PropertyTagPrintFlagsBleedWidth = 0x5008;
PropertyTagPrintFlagsBleedWidthScale = 0x5009;
PropertyTagHalftoneLPI = 0x500A;
PropertyTagHalftoneLPIUnit = 0x500B;
PropertyTagHalftoneDegree = 0x500C;
PropertyTagHalftoneShape = 0x500D;
PropertyTagHalftoneMisc = 0x500E;
PropertyTagHalftoneScreen = 0x500F;
PropertyTagJPEGQuality = 0x5010;
PropertyTagGridSize = 0x5011;
PropertyTagThumbnailFormat = 0x5012;            // 1= JPEG, 0 = RAW RGB
PropertyTagThumbnailWidth = 0x5013;
PropertyTagThumbnailHeight = 0x5014;
PropertyTagThumbnailColorDepth = 0x5015;
PropertyTagThumbnailPlanes = 0x5016;
PropertyTagThumbnailRawBytes = 0x5017;
PropertyTagThumbnailSize = 0x5018;
PropertyTagThumbnailCompressedSize = 0x5019;
PropertyTagColorTransferFunction = 0x501A;
PropertyTagThumbnailData = 0x501B;
PropertyTagThumbnailImageWidth = 0x5020;        // Thumbnail width;
PropertyTagThumbnailImageHeight = 0x5021;       // Thumbnail height;
PropertyTagThumbnailBitsPerSample = 0x5022;     // Number of bits per;  // component;
PropertyTagThumbnailCompression = 0x5023;       // Compression Scheme;
PropertyTagThumbnailPhotometricInterp = 0x5024; // Pixel composition;
PropertyTagThumbnailImageDescription = 0x5025;  // Image Tile;
PropertyTagThumbnailEquipMake = 0x5026;         // Manufacturer of Image;   // Input equipment;
PropertyTagThumbnailEquipModel = 0x5027;        // Model of Image input;  // equipment;
PropertyTagThumbnailStripOffsets = 0x5028;      // Image data location;
PropertyTagThumbnailOrientation = 0x5029 ;      // Orientation of image;
PropertyTagThumbnailSamplesPerPixel = 0x502A ;  // Number of components;
PropertyTagThumbnailRowsPerStrip = 0x502B ;     // Number of rows per strip;
PropertyTagThumbnailStripBytesCount = 0x502C;   // Bytes per compressed;  // strip;
PropertyTagThumbnailResolutionX = 0x502D;       // Resolution in width;  // direction;
PropertyTagThumbnailResolutionY = 0x502E;       // Resolution in height;  // direction;
PropertyTagThumbnailPlanarConfig = 0x502F;      // Image data arrangement;
PropertyTagThumbnailResolutionUnit = 0x5030;    // Unit of X and Y;     // Resolution;
PropertyTagThumbnailTransferFunction = 0x5031;  // Transfer function;
PropertyTagThumbnailSoftwareUsed = 0x5032;      // Software used;
PropertyTagThumbnailDateTime = 0x5033;          // File change double and;  // time;
PropertyTagThumbnailArtist = 0x5034;            // Person who created the;  // image;
PropertyTagThumbnailWhitePoint = 0x5035;        // White point chromaticity;
PropertyTagThumbnailPrimaryChromaticities = 0x5036;  // Chromaticities of; // primaries;
PropertyTagThumbnailYCbCrCoefficients = 0x5037; // Color space transforma-;   // tion coefficients;
PropertyTagThumbnailYCbCrSubsampling = 0x5038;  // Subsampling ratio of Y;   // to C;
PropertyTagThumbnailYCbCrPositioning = 0x5039;  // Y and C position;
PropertyTagThumbnailRefBlackWhite = 0x503A;     // Pair of black and white;  // reference values;
PropertyTagThumbnailCopyRight = 0x503B;         // CopyRight holder; 
PropertyTagLuminanceTable = 0x5090;
PropertyTagChrominanceTable = 0x5091; 
PropertyTagFrameDelay = 0x5100;
PropertyTagLoopCount = 0x5101; 
PropertyTagPixelUnit = 0x5110;          // Unit specifier for pixel/unit;
PropertyTagPixelPerUnitX = 0x5111;      // Pixels per unit in X;
PropertyTagPixelPerUnitY = 0x5112;      // Pixels per unit in Y;
PropertyTagPaletteHistogram = 0x5113;   // Palette histogram;

PropertyTagExifExposureTime = 0x829A;
PropertyTagExifFNumber = 0x829D;

PropertyTagExifExposureProg = 0x8822;
PropertyTagExifSpectralSense = 0x8824;
PropertyTagExifISOSpeed = 0x8827;
PropertyTagExifOECF = 0x8828;

PropertyTagExifVer = 0x9000;
PropertyTagExifDTOrig = 0x9003;         // double & time of original;
PropertyTagExifDTDigitized = 0x9004;    // double & time of digital data generation;

PropertyTagExifCompConfig = 0x9101;
PropertyTagExifCompBPP = 0x9102;

PropertyTagExifShutterSpeed = 0x9201;
PropertyTagExifAperture = 0x9202;
PropertyTagExifBrightness = 0x9203;
PropertyTagExifExposureBias = 0x9204;
PropertyTagExifMaxAperture = 0x9205;
PropertyTagExifSubjectDist = 0x9206;
PropertyTagExifMeteringMode = 0x9207;
PropertyTagExifLightSource = 0x9208;
PropertyTagExifFlash = 0x9209;
PropertyTagExifFocalLength = 0x920A;
PropertyTagExifMakerNote = 0x927C;
PropertyTagExifUserComment = 0x9286;
PropertyTagExifDTSubsec = 0x9290;        // double & Time subseconds;
PropertyTagExifDTOrigSS = 0x9291;        // double & Time original subseconds;
PropertyTagExifDTDigSS = 0x9292;         // double & TIme digitized subseconds;

PropertyTagExifFPXVer = 0xA000;
PropertyTagExifColorSpace = 0xA001;
PropertyTagExifPixXDim = 0xA002;
PropertyTagExifPixYDim = 0xA003;
PropertyTagExifRelatedWav = 0xA004;      // related sound file;
PropertyTagExifInterop = 0xA005;
PropertyTagExifFlashEnergy = 0xA20B;
PropertyTagExifSpatialFR = 0xA20C;       // Spatial Frequency Response;
PropertyTagExifFocalXRes = 0xA20E ;      // Focal Plane X Resolution;
PropertyTagExifFocalYRes = 0xA20F;       // Focal Plane Y Resolution;
PropertyTagExifFocalResUnit = 0xA210;    // Focal Plane Resolution Unit;
PropertyTagExifSubjectLoc = 0xA214;
PropertyTagExifExposureIndex = 0xA215;
PropertyTagExifSensingMethod = 0xA217;
PropertyTagExifFileSource = 0xA300;
PropertyTagExifSceneType = 0xA301;
PropertyTagExifCfaPattern = 0xA302;

PropertyTagGpsVer = 0x0;
PropertyTagGpsLatitudeRef = 0x1;
PropertyTagGpsLatitude = 0x2;
PropertyTagGpsLongitudeRef = 0x3;
PropertyTagGpsLongitude = 0x4;
PropertyTagGpsAltitudeRef = 0x5;
PropertyTagGpsAltitude = 0x6;
PropertyTagGpsGpsTime = 0x7;
PropertyTagGpsGpsSatellites = 0x8;
PropertyTagGpsGpsStatus = 0x9;
PropertyTagGpsGpsMeasureMode = 0xA;
PropertyTagGpsGpsDop = 0xB;             // Measurement precision;
PropertyTagGpsSpeedRef = 0xC;
PropertyTagGpsSpeed = 0xD;
PropertyTagGpsTrackRef = 0xE;
PropertyTagGpsTrack = 0xF;
PropertyTagGpsImgDirRef = 0x10;
PropertyTagGpsImgDir = 0x11;
PropertyTagGpsMapDatum = 0x12;
PropertyTagGpsDestLatRef = 0x13;
PropertyTagGpsDestLat = 0x14;
PropertyTagGpsDestLongRef = 0x15;
PropertyTagGpsDestLong = 0x16;
PropertyTagGpsDestBearRef = 0x17;
PropertyTagGpsDestBear = 0x18;
PropertyTagGpsDestDistRef = 0x19;
PropertyTagGpsDestDist = 0x1A;
}

//=================================
//Palette
PaletteFlags={ 
PaletteFlagsHasAlpha = 0x1;
PaletteFlagsGrayScale = 0x2;
PaletteFlagsHalftone = 0x4;
}

//=================================
//Rotate
RotateFlipType={ 
RotateNoneFlipNone = 0;
Rotate90FlipNone = 1;
Rotate180FlipNone = 2;
Rotate270FlipNone = 3;

RotateNoneFlipX = 4;
Rotate90FlipX = 5;
Rotate180FlipX = 6;
Rotate270FlipX = 7;

RotateNoneFlipY = 6;
Rotate90FlipY =  7;
Rotate180FlipY =  4;
Rotate270FlipY =  5;

RotateNoneFlipXY =  R2;
Rotate90FlipXY =  3;
Rotate180FlipXY =  0;
Rotate270FlipXY = 1;
}

//=================================
//Colors
colors={ 
AliceBlue = 0xFFF0F8FF;
AntiqueWhite = 0xFFFAEBD7;
Aqua = 0xFF00FFFF;
Aquamarine = 0xFF7FFFD4;
Azure = 0xFFF0FFFF;
Beige = 0xFFF5F5DC;
Bisque = 0xFFFFE4C4;
Black = 0xFF000000;
BlanchedAlmond = 0xFFFFEBCD;
Blue = 0xFF0000FF;
BlueViolet = 0xFF8A2BE2;
Brown = 0xFFA52A2A;
BurlyWood = 0xFFDEB887;
CadetBlue = 0xFF5F9EA0;
Chartreuse = 0xFF7FFF00;
Chocolate = 0xFFD2691E;
Coral = 0xFFFF7F50;
CornflowerBlue = 0xFF6495ED;
Cornsilk = 0xFFFFF8DC;
Crimson = 0xFFDC143C;
Cyan = 0xFF00FFFF;
DarkBlue = 0xFF00008B;
DarkCyan = 0xFF008B8B;
DarkGoldenrod = 0xFFB8860B;
DarkGray = 0xFFA9A9A9;
DarkGreen = 0xFF006400;
DarkKhaki = 0xFFBDB76B;
DarkMagenta = 0xFF8B008B;
DarkOliveGreen = 0xFF556B2F;
DarkOrange = 0xFFFF8C00;
DarkOrchid = 0xFF9932CC;
DarkRed = 0xFF8B0000;
DarkSalmon = 0xFFE9967A;
DarkSeaGreen = 0xFF8FBC8B;
DarkSlateBlue = 0xFF483D8B;
DarkSlateGray = 0xFF2F4F4F;
DarkTurquoise = 0xFF00CED1;
DarkViolet = 0xFF9400D3;
DeepPink = 0xFFFF1493;
DeepSkyBlue = 0xFF00BFFF;
DimGray = 0xFF696969;
DodgerBlue = 0xFF1E90FF;
Firebrick = 0xFFB22222;
FloralWhite = 0xFFFFFAF0;
ForestGreen = 0xFF228B22;
Fuchsia = 0xFFFF00FF;
Gainsboro = 0xFFDCDCDC;
GhostWhite = 0xFFF8F8FF;
Gold = 0xFFFFD700;
Goldenrod = 0xFFDAA520;
Gray = 0xFF808080;
Green = 0xFF008000;
GreenYellow = 0xFFADFF2F;
Honeydew = 0xFFF0FFF0;
HotPink = 0xFFFF69B4;
IndianRed = 0xFFCD5C5C;
Indigo = 0xFF4B0082;
Ivory = 0xFFFFFFF0;
Khaki = 0xFFF0E68C;
Lavender = 0xFFE6E6FA;
LavenderBlush = 0xFFFFF0F5;
LawnGreen = 0xFF7CFC00;
LemonChiffon = 0xFFFFFACD;
LightBlue = 0xFFADD8E6;
LightCoral = 0xFFF08080;
LightCyan = 0xFFE0FFFF;
LightGoldenrodYellow = 0xFFFAFAD2;
LightGray = 0xFFD3D3D3;
LightGreen = 0xFF90EE90;
LightPink = 0xFFFFB6C1;
LightSalmon = 0xFFFFA07A;
LightSeaGreen = 0xFF20B2AA;
LightSkyBlue = 0xFF87CEFA;
LightSlateGray = 0xFF778899;
LightSteelBlue = 0xFFB0C4DE;
LightYellow = 0xFFFFFFE0;
Lime = 0xFF00FF00;
LimeGreen = 0xFF32CD32;
Linen = 0xFFFAF0E6;
Magenta = 0xFFFF00FF;
Maroon = 0xFF800000;
MediumAquamarine = 0xFF66CDAA;
MediumBlue = 0xFF0000CD;
MediumOrchid = 0xFFBA55D3;
MediumPurple = 0xFF9370DB;
MediumSeaGreen = 0xFF3CB371;
MediumSlateBlue = 0xFF7B68EE;
MediumSpringGreen = 0xFF00FA9A;
MediumTurquoise = 0xFF48D1CC;
MediumVioletRed = 0xFFC71585;
MidnightBlue = 0xFF191970;
MintCream = 0xFFF5FFFA;
MistyRose = 0xFFFFE4E1;
Moccasin = 0xFFFFE4B5;
NavajoWhite = 0xFFFFDEAD;
Navy = 0xFF000080;
OldLace = 0xFFFDF5E6;
Olive = 0xFF808000;
OliveDrab = 0xFF6B8E23;
Orange = 0xFFFFA500;
OrangeRed = 0xFFFF4500;
Orchid = 0xFFDA70D6;
PaleGoldenrod = 0xFFEEE8AA;
PaleGreen = 0xFF98FB98;
PaleTurquoise = 0xFFAFEEEE;
PaleVioletRed = 0xFFDB7093;
PapayaWhip = 0xFFFFEFD5;
PeachPuff = 0xFFFFDAB9;
Peru = 0xFFCD853F;
Pink = 0xFFFFC0CB;
Plum = 0xFFDDA0DD;
PowderBlue = 0xFFB0E0E6;
Purple = 0xFF800080;
Red = 0xFFFF0000;
RosyBrown = 0xFFBC8F8F;
RoyalBlue = 0xFF4169E1;
SaddleBrown = 0xFF8B4513;
Salmon = 0xFFFA8072;
SandyBrown = 0xFFF4A460;
SeaGreen = 0xFF2E8B57;
SeaShell = 0xFFFFF5EE;
Sienna = 0xFFA0522D;
Silver = 0xFFC0C0C0;
SkyBlue = 0xFF87CEEB;
SlateBlue = 0xFF6A5ACD;
SlateGray = 0xFF708090;
Snow = 0xFFFFFAFA;
SpringGreen = 0xFF00FF7F;
SteelBlue = 0xFF4682B4;
Tan = 0xFFD2B48C;
Teal = 0xFF008080;
Thistle = 0xFFD8BFD8;
Tomato = 0xFFFF6347;
Transparent = 0xFFFFFF;
Turquoise = 0xFF40E0D0;
Violet = 0xFFEE82EE;
Wheat = 0xFFF5DEB3;
White = 0xFFFFFFFF;
WhiteSmoke = 0xFFF5F5F5;
Yellow = 0xFFFFFF00;
YellowGreen = 0xFF9ACD32;
}

ColorMode={ 
ColorModeARGB32 = 0;
ColorModeARGB64 = 1;
}

ColorChannelFlags={ 
ColorChannelFlagsC = 0;
ColorChannelFlagsM;
ColorChannelFlagsY;
ColorChannelFlagsK;
ColorChannelFlagsLast;
}

ColorShiftComponents={ 
AlphaShift = 24;
RedShift = 16;
GreenShift = 8;
BlueShift = 0;
}

ColorMaskComponents={ 
AlphaMask = 0xFF000000;
RedMask = 0xFF0000;
GreenMask = 0xFF00;
BlueMask = 0xFF;
}

//=================================
//string
StringFormatFlags={ 
StringFormatFlagsDirectionRightToLeft = 0x1;
StringFormatFlagsDirectionVertical = 0x2;
StringFormatFlagsNoFitBlackBox = 0x4;
StringFormatFlagsDisplayFormatControl = 0x20;
StringFormatFlagsNoFontFallback = 0x400;
StringFormatFlagsMeasureTrailingSpaces = 0x800;
StringFormatFlagsNoWrap = 0x1000;
StringFormatFlagsLineLimit = 0x2000;

StringFormatFlagsNoClip = 0x4000;
}

StringTrimming={ 
StringTrimmingNone = 0;
StringTrimmingCharacter = 1;
StringTrimmingWord = 2;
StringTrimmingEllipsisCharacter = 3;
StringTrimmingEllipsisWord = 4;
StringTrimmingEllipsisPath = 5;
}

StringDigitSubstitute={ 
StringDigitSubstituteUser = 0;
StringDigitSubstituteNone = 1;
StringDigitSubstituteNational = 2;
StringDigitSubstituteTraditional = 3;
}

//=================================
//Pen / Brush
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=53;
HatchStyleLargeGrid  =4;

HatchStyleMin = 0;
HatchStyleMax = 53 - 1;
}

PenAlignment={ 
PenAlignmentCenter = 0;
PenAlignmentInset = 1;
}

BrushType={ 
BrushTypeSolidColor = 0;
BrushTypeHatchFill = 1;
BrushTypeTextureFill = 2;
BrushTypePathGradient = 3;
BrushTypeLinearGradient = 4;
}

DashStyle={ 
DashStyleSolid;
DashStyleDash;
DashStyleDot;
DashStyleDashDot;
DashStyleDashDotDot;
DashStyleCustom;
}

DashCap={ 
DashCapFlat = 0;
DashCapRound = 2;
DashCapTriangle = 3;
}

LineCap={ 
LineCapFlat = 0;
LineCapSquare = 1;
LineCapRound = 2;
LineCapTriangle = 3;

LineCapNoAnchor = 0x10;         // corresponds to flat cap;
LineCapSquareAnchor = 0x11;     // corresponds to square cap;
LineCapRoundAnchor = 0x12 ;     // corresponds to round cap;
LineCapDiamondAnchor = 0x13;    // corresponds to triangle cap;
LineCapArrowAnchor = 0x14;      // no correspondence;

LineCapCustom = 0xFF;           // custom cap;

LineCapAnchorMask = 0xF0;        // mask to check for anchor or not.;
}

CustomLineCapType={ 
CustomLineCapTypeDefault = 0;
CustomLineCapTypeAdjustableArrow = 1;
}

LineJoin={ 
LineJoinMiter = 0;
LineJoinBevel = 1;
LineJoinRound = 2;
LineJoinMiterClipped = 3;
}

PenType={ 
PenTypeSolidColor = BrushType.BrushTypeSolidColor;
PenTypeHatchFill = BrushType.BrushTypeHatchFill;
PenTypeTextureFill = BrushType.BrushTypeTextureFill;
PenTypePathGradient = BrushType.BrushTypePathGradient;
PenTypeLinearGradient = BrushType.BrushTypeLinearGradient;
PenTypeUnknown = -1;
}

//=================================
//Meta File
MetafileType={ 
MetafileTypeInvalid     =0;       // Invalid metafile;
MetafileTypeWmf         =1;       // Standard WMF;
MetafileTypeWmfPlaceable =2;      // Placeable WMF;
MetafileTypeEmf          =3;     // EMF (not EMF+);
MetafileTypeEmfPlusOnly  =4;     // EMF+ without dual down-level records;
MetafileTypeEmfPlusDual  =5;      // EMF+ with dual down-level records;
}

EmfType={ 
EmfTypeEmfOnly = MetafileType.MetafileTypeEmf ;              // no EMF+  only EMF;
EmfTypeEmfPlusOnly =  MetafileType.MetafileTypeEmfPlusOnly;   // no EMF  only EMF+;
EmfTypeEmfPlusDual =  MetafileType.MetafileTypeEmfPlusDual ;  // both EMF+ and EMF;
}

ObjectType={ 
ObjectTypeInvalid=0;
ObjectTypeBrush=1;
ObjectTypePen=2;
ObjectTypePath=3;
ObjectTypeRegion=4;
ObjectTypeImage=5;
ObjectTypeFont=6;
ObjectTypeStringFormat=7;
ObjectTypeImageAttributes=8;
ObjectTypeCustomLineCap=9; 
ObjectTypeMax = ObjectTypeCustomLineCap=10;
ObjectTypeMin = ObjectTypeBrush=11;
}

MetafileFrameUnit={ 
MetafileFrameUnitPixel = GpUnit.UnitPixel;
MetafileFrameUnitPoint =  GpUnit.UnitPoint;
MetafileFrameUnitInch =  GpUnit.UnitInch;
MetafileFrameUnitDocument =  GpUnit.UnitDocument;
MetafileFrameUnitMillimeter =  GpUnit.UnitMillimeter;
MetafileFrameUnitGdi = 7;                      // GDI compatible .01 MM units;
}

// Coordinate space identifiers
CoordinateSpace={ 
CoordinateSpaceWorld     =0;
CoordinateSpacePage      =1;
CoordinateSpaceDevice     =2;
}

EmfPlusRecordType={ 
WmfRecordTypeSetBkColor = 0x10201;
WmfRecordTypeSetBkMode = 0x10102;
WmfRecordTypeSetMapMode = 0x10103;
WmfRecordTypeSetROP2 = 0x10104;
WmfRecordTypeSetRelAbs = 0x10105;
WmfRecordTypeSetPolyFillMode = 0x10106;
WmfRecordTypeSetStretchBltMode = 0x10107;
WmfRecordTypeSetTextCharExtra = 0x10108;
WmfRecordTypeSetTextColor = 0x10209;
WmfRecordTypeSetTextJustification = 0x1020A;
WmfRecordTypeSetWindowOrg = 0x1020B;
WmfRecordTypeSetWindowExt = 0x1020C;
WmfRecordTypeSetViewportOrg = 0x1020D;
WmfRecordTypeSetViewportExt = 0x1020E;
WmfRecordTypeOffsetWindowOrg = 0x1020F;
WmfRecordTypeScaleWindowExt = 0x10410;
WmfRecordTypeOffsetViewportOrg = 0x10211;
WmfRecordTypeScaleViewportExt = 0x10412;
WmfRecordTypeLineTo = 0x10213;
WmfRecordTypeMoveTo = 0x10214;
WmfRecordTypeExcludeClipRect = 0x10415;
WmfRecordTypeIntersectClipRect = 0x10416;
WmfRecordTypeArc = 0x10817;
WmfRecordTypeEllipse = 0x10418;
WmfRecordTypeFloodFill = 0x10419;
WmfRecordTypePie = 0x1081A;
WmfRecordTypeRectangle = 0x1041B;
WmfRecordTypeRoundRect = 0x1061C;
WmfRecordTypePatBlt = 0x1061D;
WmfRecordTypeSaveDC = 0x1001E;
WmfRecordTypeSetPixel = 0x1041F;
WmfRecordTypeOffsetClipRgn = 0x10220;
WmfRecordTypeTextOut = 0x10521;
WmfRecordTypeBitBlt = 0x10922;
WmfRecordTypeStretchBlt = 0x10B23;
WmfRecordTypePolygon = 0x10324;
WmfRecordTypePolyline = 0x10325;
WmfRecordTypeEscape = 0x10626;
WmfRecordTypeRestoreDC = 0x10127;
WmfRecordTypeFillRegion = 0x10228;
WmfRecordTypeFrameRegion = 0x10429;
WmfRecordTypeInvertRegion = 0x1012A;
WmfRecordTypePaintRegion = 0x1012B;
WmfRecordTypeSelectClipRegion = 0x1012C;
WmfRecordTypeSelectObject = 0x1012D;
WmfRecordTypeSetTextAlign = 0x1012E;
WmfRecordTypeDrawText = 0x1062F;
WmfRecordTypeChord = 0x10830;
WmfRecordTypeSetMapperFlags = 0x10231;
WmfRecordTypeExtTextOut = 0x10A32;
WmfRecordTypeSetDIBToDev = 0x10D33;
WmfRecordTypeSelectPalette = 0x10234;
WmfRecordTypeRealizePalette = 0x10035;
WmfRecordTypeAnimatePalette = 0x10436;
WmfRecordTypeSetPalEntries = 0x10037;
WmfRecordTypePolyPolygon = 0x10538;
WmfRecordTypeResizePalette = 0x10139;
WmfRecordTypeDIBBitBlt = 0x10940;
WmfRecordTypeDIBStretchBlt = 0x10B41;
WmfRecordTypeDIBCreatePatternBrush = 0x10142;
WmfRecordTypeStretchDIB = 0x10F43;
WmfRecordTypeExtFloodFill = 0x10548;
WmfRecordTypeSetLayout = 0x10149;
WmfRecordTypeResetDC = 0x1014C;
WmfRecordTypeStartDoc = 0x1014D;
WmfRecordTypeStartPage = 0x1004F;
WmfRecordTypeEndPage = 0x10050;
WmfRecordTypeAbortDoc = 0x10052;
WmfRecordTypeEndDoc = 0x1005E;
WmfRecordTypeDeleteObject = 0x101F0;
WmfRecordTypeCreatePalette = 0x100F7;
WmfRecordTypeCreateBrush = 0x100F8;
WmfRecordTypeCreatePatternBrush = 0x101F9;
WmfRecordTypeCreatePenIndirect = 0x102FA;
WmfRecordTypeCreateFontIndirect = 0x102FB;
WmfRecordTypeCreateBrushIndirect = 0x102FC;
WmfRecordTypeCreateBitmapIndirect = 0x102FD;
WmfRecordTypeCreateBitmap = 0x106FE;
WmfRecordTypeCreateRegion = 0x106FF;
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;

EmfPlusRecordTypeInvalid = 16384; ////GDIP_EMFPLUS_RECORD_BASE;
EmfPlusRecordTypeHeader = 16385;
EmfPlusRecordTypeEndOfFile = 16386;
EmfPlusRecordTypeComment = 16387;
EmfPlusRecordTypeGetDC = 16388;
EmfPlusRecordTypeMultiFormatStart = 16389;
EmfPlusRecordTypeMultiFormatSection = 16390;
EmfPlusRecordTypeMultiFormatEnd = 16391;

EmfPlusRecordTypeObject = 16392;

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;

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;
}

//=================================
//Other
HotkeyPrefix={ 
HotkeyPrefixNone = 0;
HotkeyPrefixShow = 1;
HotkeyPrefixHide = 2;
}


FlushIntention={ 
FlushIntentionFlush = 0 ;        // Flush all batched rendering operations;
FlushIntentionSync = 1 ;         // Flush all batched rendering operations;
}

EncoderParameterValueType={ 
EncoderParameterValueTypeByte = 1;              //8 -bit unsigned int
EncoderParameterValueTypeASCII = 2;             //8 -bi 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 int is the;
                                           // numerator the second int expresses the;
                                           // denomintor.;
EncoderParameterValueTypeLongRange = 6;         // Two longs which specify a range of;
                                           // word values. The first int 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 pointer 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;
}

EncoderValue={ 
EncoderValueColorTypeCMYK=0;
EncoderValueColorTypeYCCK=1;
EncoderValueCompressionLZW=2;
EncoderValueCompressionCCITT3=3;
EncoderValueCompressionCCITT4=4;
EncoderValueCompressionRle=5;
EncoderValueCompressionNone=6;
EncoderValueScanMethodInterlaced=7;
EncoderValueScanMethodNonInterlaced=8;
EncoderValueVersionGif87=9;
EncoderValueVersionGif89=10;
EncoderValueRenderProgressive=11;
EncoderValueRenderNonProgressive=12;
EncoderValueTransformRotate90=13;
EncoderValueTransformRotate180=14;
EncoderValueTransformRotate270=15;
EncoderValueTransformFlipHorizontal=16;
EncoderValueTransformFlipVertical=17;
EncoderValueMultiFrame=18;
EncoderValueLastFrame=19;
EncoderValueFlush=20;
EncoderValueFrameDimensionTime=21;
EncoderValueFrameDimensionResolution=22;
EncoderValueFrameDimensionPage=23;
}

DebugEventLevel={ 
DebugEventLevelFatal=0;
DebugEventLevelWarning=1;
}

CreateFromHDC2 = Gdiplus.api("GdipCreateFromHDC2","int(POINTER hDc,int hDevice,pointer& Graphics)")
CreateFromHWNDICM = Gdiplus.api("GdipCreateFromHWNDICM","int(int hwnd,pointer& Graphics)")

EnumerateMetafileDestPoint = Gdiplus.api("GdipEnumerateMetafileDestPoint","int(POINTER Graphics,int metafile,struct& destPoint,int& lpEnumerateMetafileProc,int callbackData,int& imageAttributes)")
EnumerateMetafileDestPointI = Gdiplus.api("GdipEnumerateMetafileDestPointI","int(POINTER Graphics,int metafile,struct& destPoint,int lpEnumerateMetafileProc,int callbackData,int imageAttributes)")
EnumerateMetafileDestRect = Gdiplus.api("GdipEnumerateMetafileDestRect","int(POINTER Graphics,int metafile,struct& destRect,int& lpEnumerateMetafileProc,int callbackData,int& imageAttributes)")
EnumerateMetafileDestRectI = Gdiplus.api("GdipEnumerateMetafileDestRectI","int(POINTER Graphics,int metafile,struct& destRect,int& lpEnumerateMetafileProc,int callbackData,int& imageAttributes)")
EnumerateMetafileDestPoints = Gdiplus.api("GdipEnumerateMetafileDestPoints","int(POINTER Graphics,int metafile,struct& destPoint,int count,int& lpEnumerateMetafileProc,int callbackData,int& imageAttributes)")
EnumerateMetafileDestPointsI = Gdiplus.api("GdipEnumerateMetafileDestPointsI","int(POINTER Graphics,int metafile,struct& destPoint,int count,int& lpEnumerateMetafileProc,int callbackData,int& imageAttributes)")
EnumerateMetafileSrcRectDestPoint = Gdiplus.api("GdipEnumerateMetafileSrcRectDestPoint","int(POINTER Graphics,int metafile,struct& destPoint,struct& srcRect,int srcUnit,int lpEnumerateMetafileProc,int callbackData,int imageAttributes)")
EnumerateMetafileSrcRectDestPointI = Gdiplus.api("GdipEnumerateMetafileSrcRectDestPointI","int(POINTER Graphics,int metafile,struct& destPoint,struct& srcRect,int srcUnit,int lpEnumerateMetafileProc,int callbackData,int imageAttributes)")
EnumerateMetafileSrcRectDestRect = Gdiplus.api("GdipEnumerateMetafileSrcRectDestRect","int(POINTER Graphics,int metafile,struct& destRect,struct& srcRect,int srcUnit,int lpEnumerateMetafileProc,int callbackData,int imageAttributes)")
EnumerateMetafileSrcRectDestRectI = Gdiplus.api("GdipEnumerateMetafileSrcRectDestRectI","int(POINTER Graphics,int metafile,struct& destRect,struct& srcRect,int srcUnit,int lpEnumerateMetafileProc,int callbackData,int imageAttributes)")
EnumerateMetafileSrcRectDestPoints = Gdiplus.api("GdipEnumerateMetafileSrcRectDestPoints","int(POINTER Graphics,int metafile,struct& destPoints,int count,struct& srcRect,int srcUnit,int lpEnumerateMetafileProc,int callbackData,int imageAttributes)")
EnumerateMetafileSrcRectDestPointsI = Gdiplus.api("GdipEnumerateMetafileSrcRectDestPointsI","int(POINTER Graphics,int metafile,struct& destPoints,int count,struct& srcRect,int srcUnit,int lpEnumerateMetafileProc,int callbackData,int imageAttributes)")
PlayMetafileRecord = Gdiplus.api("GdipPlayMetafileRecord","int(int metafile,struct recordType,int flags,int dataSize,pointer& byteData)")

GetMetafileHeaderFromWmf = Gdiplus.api("GdipGetMetafileHeaderFromWmf","int(int hWmf,struct& WmfPlaceableFileHdr,struct& header)")
GetMetafileHeaderFromEmf = Gdiplus.api("GdipGetMetafileHeaderFromEmf","int(int hEmf,struct& header)")
GetMetafileHeaderFromFile = Gdiplus.api("GdipGetMetafileHeaderFromFile","int(string FileName,struct& header)")
GetMetafileHeaderFromStream = Gdiplus.api("GdipGetMetafileHeaderFromStream","int(POINTER stream,struct& header)")
GetMetafileHeaderFromMetafile = Gdiplus.api("GdipGetMetafileHeaderFromMetafile","int(int metafile,struct& header)")
GetHemfFromMetafile = Gdiplus.api("GdipGetHemfFromMetafile","int(int metafile,int& hEmf)")
CreateStreamOnFile = Gdiplus.api("GdipCreateStreamOnFile","int(string FileName,int access,pointer& stream)")
CreateMetafileFromWmf = Gdiplus.api("GdipCreateMetafileFromWmf","int(int hWmf,int bDeleteWmf,struct& WmfPlaceableFileHdr,int metafile)")
CreateMetafileFromEmf = Gdiplus.api("GdipCreateMetafileFromEmf","int(int hEmf,int bDeleteEmf,int& metafile)")
CreateMetafileFromFile = Gdiplus.api("GdipCreateMetafileFromFile","int(int file,int& metafile)")
CreateMetafileFromWmfFile = Gdiplus.api("GdipCreateMetafileFromWmfFile","int(int file,struct& WmfPlaceableFileHdr,int& metafile)")
CreateMetafileFromStream = Gdiplus.api("GdipCreateMetafileFromStream","int(POINTER stream,int& metafile)")
RecordMetafile = Gdiplus.api("GdipRecordMetafile","int(int referenceHdc,struct& etype,struct& frameRect,struct frameUnit,int description,int& metafile)")
RecordMetafileI = Gdiplus.api("GdipRecordMetafileI","int(int referenceHdc,struct& etype,struct& frameRect,struct frameUnit,int description,int& metafile)")
RecordMetafileFileName = Gdiplus.api("GdipRecordMetafileFileName","int(string FileName,int referenceHdc,struct& etype,struct& frameRect,struct frameUnit,int description,int& metafile)")
RecordMetafileFileNameI = Gdiplus.api("GdipRecordMetafileFileNameI","int(string FileName,int referenceHdc,struct& etype,struct& frameRect,struct frameUnit,int description,int& metafile)")
RecordMetafileStream = Gdiplus.api("GdipRecordMetafileStream","int(POINTER stream,int referenceHdc,struct& etype,struct& frameRect,struct frameUnit,int description,int& metafile)")
RecordMetafileStreamI = Gdiplus.api("GdipRecordMetafileStreamI","int(POINTER stream,int referenceHdc,struct& etype,struct& frameRect,struct frameUnit,int description,int& metafile)")
SetMetafileDownLevelRasterizationLimit = Gdiplus.api("GdipSetMetafileDownLevelRasterizationLimit","int(int metafile,int metafileRasterizationLimitDpi)")
GetMetafileDownLevelRasterizationLimit = Gdiplus.api("GdipGetMetafileDownLevelRasterizationLimit","int(int metafile,int& metafileRasterizationLimitDpi)")
GetImageDecodersSize = Gdiplus.api("GdipGetImageDecodersSize","int(int& numDecoders,int& size)")

Flush = Gdiplus.api("GdipFlush","int(POINTER Graphics,struct intention)")
Alloc = Gdiplus.api("GdipAlloc","int(int size)")
Free = Gdiplus.api("GdipFree","void(int ptr)")


//===================================================================================
//  公共部分 / 其他部分
//===================================================================================
checkError = function(re,ci = 1){
	if( re)
		error(errMsg[re],ci + 1)
}
self.assert :=  function(re,...){
	checkError(re,2);  
	return ...
}

GdiplusStartup = Gdiplus.api("GdiplusStartup","int(int& token,struct& inputbuf,pointer outputbuf)")
GdiplusShutdown = Gdiplus.api("GdiplusShutdown","int(int token)")
GdiplusStartupInput = class{ 
	int GdiplusVersion; 
	int DebugEventCallback; 
	int SuppressBackgroundThread; 
	int SuppressExternalCodecs;
}
 
 
var defaultToken;
_defaultToken_gc = ..gcdata(
	_gc = function(){ 
		close(defaultToken);
	} 
)
function open(){
	if(defaultToken)
		return;
		
	var uInput = GdiplusStartupInput();
	uInput.GdiplusVersion = 1 
	var re,token = GdiplusStartup(0,uInput); 
	if(re)
		error("GDI+ 初始化错误。" ,2)  
	defaultToken = token;
}
function close(){  
	if(defaultToken){ 
		GdiplusShutdown(defaultToken);
	}
} 
open();
/**intellisense()
open() = 初始化GDI+\n导入gdip时会默认执行此函数
close() =  关闭GDI+\n在程序退出时会自动调用此函数\n一般不需要显示调用此函数
errMsg[] = 根据返回值取错误信息
checkError(__/*请输入GDI+函数返回值*/) = 如果有错误调用error函数抛出异常
checkError(__/*请输入GDI+函数返回值*/,2) = 如果有错误调用error函数抛出异常\n参数2指定抛出异常的调用级别\n2表示调用当前函数的函数
assert(__/*请输入GDI+函数返回值*/) = 校验GDI+函数返回值\n如果返回值非零，则抛出错误信息\n否则返回该函数的所有输出参数
end intellisense**/


EncoderParameter= class{ 
	struct Guid = ..win.guid();
	INT NumberOfValues; 
	INT type; 
	pointer value; 
}
var EncoderParameter = EncoderParameter;
EncoderParameters= class{ 
	int count = 1; 
	struct Parameter = EncoderParameter(); 
}
ImageType={ 
BMP=0;
EMF=1;
WMF=2;
JPG=3;
PNG=4;
GIF=5;
TIF=6;
ICO=7;
}
encoder = { 
	//EncoderParameter.GUID 参数常用的GUID标识有压缩、色深、质量等等,该参数的常用定义如下：
	/*intellisense(gdip.encoder)*/
	Compression      = "{E09D739D-CCD4-44EE-8EBA-3FBF8BE4FC58}";
	ColorDepth       = "{66087055-AD66-4C7C-9A18-38A2310B8337}";
	ScanMethod       = "{3A4E2661-3109-4E56-8536-42C156E7DCFA}";
	Version          = "{24D18C76-814A-41A4-BF53-1C219CCCF797}";
	RenderMethod     = "{6D42C53A-229A-4825-8BB7-5C99E2B9A8B8}";
	Quality          = "{1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB}";
	Transformation   = "{8D0EB2D1-A58E-4EA8-AA14-108074B7B6F9}";
	LuminanceTable   = "{EDB33BCE-0266-4A77-B904-27216099E717}";
	ChrominanceTable = "{F2E455DC-09B3-4316-8260-676ADA32481C}";
	SaveFlag         = "{292266FC-AC40-47BF-8CFC-A85B89A655DE}";
	/*end intellisense*/
	
	image = {
		/*intellisense(gdip.encoder.image)*/
		BMP         = "{557CF400-1A04-11D3-9A73-0000F81EF32E}";  
		JPG         = "{557CF401-1A04-11D3-9A73-0000F81EF32E}"; 
		GIF         = "{557CF402-1A04-11D3-9A73-0000F81EF32E}";  
		EMF         = "{557CF403-1A04-11D3-9A73-0000F81EF32E}";  
		WMF         = "{557CF404-1A04-11D3-9A73-0000F81EF32E}";  
		TIF         = "{557CF405-1A04-11D3-9A73-0000F81EF32E}";  
		PNG         = "{557CF406-1A04-11D3-9A73-0000F81EF32E}"; 
		ICO         = "{557CF407-1A04-11D3-9A73-0000F81EF32E}"; 
		/*end intellisense*/
	};

} 
SaveImage = function(img, path,quality,params)  {
	if(!path)return 10;//error FileNotFound
	params := EncoderParameters();
	if(quality){
		params.Parameter.Guid = ..win.guid.fromString(encoder.Quality)
		params.Parameter.NumberOfValues = 1 
		params.Parameter.type = 4 
		params.Parameter.value = ..raw.malloc({int q = quality})  
	}
	var pe = ..string.lastIndexAny(path,".");
	var ext = pe ?  ..string.sub( path,pe + 1 ) 
	var guid = encoder.image[ ..string.upper(ext) ] : encoder.image.BMP
	guid = ..win.guid.fromString( guid );
	 
    return SaveImageToFile( img
    	,..string.toUnicode( ..io.fullpath(path) )
    	,guid
    	,params ) 
} 

loadImageFromString = function(strBmp){
	var hImageMemory= ::GlobalAlloc( 0x2 /*_GMEM_MOVEABLE*/, #strBmp); //给图片分配全局内存
	var pImageMemory=::GlobalLock(hImageMemory); //锁定内存 
	::CopyMemory(pImageMemory,strBmp,#strBmp);//复制图片
	::GlobalUnlock(hImageMemory); //解锁内存
	
	var re,pIStream = ::CreateStreamOnHGlobal(pImageMemory, 1) //用全局内存初使化IStream接口指针
	
	var re, img = LoadImageFromStream(pIStream) ; 
	..com.Release(pIStream);
	return re,img;
}
loadBitmapFromString = function(strBmp){
	var hImageMemory= ::GlobalAlloc( 0x2 /*_GMEM_MOVEABLE*/, #strBmp); //给图片分配全局内存
	var pImageMemory=::GlobalLock(hImageMemory); //锁定内存 
	::CopyMemory(pImageMemory,strBmp,#strBmp);//复制图片
	::GlobalUnlock(hImageMemory); //解锁内存
	
	var re,pIStream = ::CreateStreamOnHGlobal(pImageMemory, 1) //用全局内存初使化IStream接口指针
	 
	var re, img = CreateBitmapFromStream (pIStream) ; 
	..com.Release(pIStream);
	return re,img;
}

createBitmapFromHandle = function(h,t=0){ 
	if( t === 0x1/*_IMAGE_ICON*/ ){
		return CreateBitmapFromHICON (h,0 )  
	}
	else if( t === 0x0/*_IMAGE_BITMAP*/ ){
		return CreateBitmapFromHBITMAP (h ,0)   
	}  
}



/**intellisense(gdip) 
createBitmapFromHandle( ,_IMAGE__/*类型*/) = 从句柄创建位图对象
loadImageFromString(__/*请输入图片数据*/) = 从内存字符串直接创建图像
loadBitmapFromString(__/*请输入图片数据*/) = 从内存字符串直接创建位图
SaveImage(__/*图像*/,"") = 保存图像(图像,保存路径,质量)\n根据后缀名自动设定图片格式\n可选使用第三个参数指定图片质量(jpg支持)\n可选使用gdip.EncoderParameters结构作为第四个参数
end intellisense**/

/**intellisense() 
!gdiBitmapData.Width
!gdiBitmapData.Height
!gdiBitmapData.Stride
!gdiBitmapData.PixelFormat
!gdiBitmapData.Scan0.array
?.BitmapData() = !gdiBitmapData.
end intellisense**/


