Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Control.ab	(revision 698)
@@ -57,4 +57,16 @@
 	End Function
 
+	Function AddRef() As DWord
+		AddRef = comImpl.AddRef()
+	End Function
+
+	Function Release() As DWord
+		Release = comImpl.Release()
+	End Function
+
+	Function QueryInterface(ByRef riid As IID, ByRef pv As Any) As HRESULT
+		QueryInterface = comImpl.QueryInterface(riid, pv)
+	End Function
+
 Private
 	Static Function FromHWndCore(hwnd As HWND) As Control
@@ -70,4 +82,6 @@
 	@date 2008/08/02
 	通常はCreateやCreateFormその他を使ってください。
+	ここで渡された引数は、GetCreateStructへ渡して修正の機会を与えた後に、
+	CreateWindowExへ渡される。
 	*/
 	Sub CreateEx(parent As Control, style As DWord, exStyle As DWord, hmenu As HMENU)
@@ -115,7 +129,13 @@
 
 Protected
+	/*!
+	@brief ウィンドウ作成前の初期設定確認
+	派生クラスでオーバーライドして、csを書き換えてよい。
+	書き換えられたcsを基にCreateWindowExが呼ばれる。
+	*/
 	Virtual Sub GetCreateStruct(ByRef cs As CREATESTRUCT)
 	End Sub
 
+Private
 	Sub createImpl(ByRef cs As CREATESTRUCT, parent As Control)
 		throwIfAlreadyCreated()
@@ -153,4 +173,5 @@
 	End Sub
 */
+
 	Sub BeginSubclass()
 		throwIfNotCreated()
@@ -207,6 +228,5 @@
 Private
 	Static Function makeKeysFormMsg(e As MessageArgs) As Keys
-		Dim t As DWord
-		t = e.WParam And Keys.KeyCode
+		Dim t = (e.WParam As DWord) And Keys.KeyCode
 		t Or= (GetKeyState(VK_SHIFT) As Word And &h8000) << 1
 		t Or= (GetKeyState(VK_CONTROL) As Word And &h8000) << 2
@@ -354,5 +374,14 @@
 
 	Sub OnCreateBase(sender As Object, e As MessageArgs)
-		e.Handled = e.Handled And OnCreate(New CreateArgs(e.LParam As *CREATESTRUCT))
+		Dim c = New CreateArgs(e.LParam As *CREATESTRUCT)
+		If e.LResult = -1 Then
+			c.Cancel = True
+		End If
+		e.Handled = e.Handled And OnCreate(c)
+		If c.Cancel Then
+			e.LResult = -1
+		Else
+			e.LResult = 0
+		End If
 	End Sub
 
@@ -579,5 +608,5 @@
 			.hIcon = 0
 			.hCursor = LoadImage(0, MAKEINTRESOURCE(IDC_ARROW), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE Or LR_SHARED) As HCURSOR
-			.hbrBackground = 0
+			.hbrBackground = (COLOR_3DFACE + 1) As HBRUSH
 			.lpszMenuName = 0
 			.lpszClassName = ToTCStr(WindowClassName)
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/EventArgs.ab	(revision 698)
@@ -128,5 +128,6 @@
 		This.button = button
 		This.clicks = clicks
-		This.pt = New System.Drawing.Point(x, y)
+		This.pt.X = x
+		This.pt.Y = y
 		This.delta = delta
 	End Sub
@@ -145,5 +146,5 @@
 
 	Const Function Locale() As System.Drawing.Point
-		Locale = New System.Drawing.Point(pt.X, pt.Y)
+		Locale = pt
 	End Function
 
@@ -495,6 +496,15 @@
 		CreateStruct = pcs
 	End Function
+
+	Const Function Cancel() As Boolean
+		Cancel = cancel
+	End Function
+
+	Sub Cancel(c As Boolean)
+		cancel = c
+	End Sub
 Private
 	pcs As *CREATESTRUCT
+	cancel As Boolean
 End Class
 
Index: trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/ActiveBasic/Windows/UI/Form.ab	(revision 698)
@@ -19,5 +19,4 @@
 	Sub Form()
 		AddMessageEvent(WM_COMMAND, AddressOf(OnCommand))
-		AddPaintBackground(AddressOf(OnPaintBackground))
 	End Sub
 
@@ -31,9 +30,4 @@
 			.cy = CW_USEDEFAULT
 		End With
-	End Sub
-
-	Sub OnPaintBackground(sender As Object, e As PaintBackgroundArgs)
-		Dim rc = ClientRect
-		FillRect(e.Handle, rc, (COLOR_3DFACE + 1) As HBRUSH)
 	End Sub
 
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/CharacterRange.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/CharacterRange.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/CharacterRange.ab	(revision 698)
@@ -4,52 +4,8 @@
 Namespace Drawing
 
-Class CharacterRange
-Public
-	Sub CharacterRange(f As Long, l As Long)
-		first = f
-		length = l
-	End Sub
-
-	Sub CharacterRange()
-		First = 0
-		Length = 0
-	End Sub
-
-	Function First() As Long
-		Return first
-	End Function
-
-	Sub First(f As Long)
-		first = f
-	End Sub
-
-	Function Length() As Long
-		Return length
-	End Function
-
-	Sub Length(l As Long)
-		length = l
-	End Sub
-
-	Function Operator ==(c As CharacterRange) As Boolean
-		Return Equals(c)
-	End Function
-
-	Function Operator <>(c As CharacterRange) As Boolean
-		Return Not Equals(c)
-	End Function
-
-	Function Equals(c As CharacterRange) As Boolean
-		Return first = c.first And length = c.length
-	End Function
-
-	Override Function GetHashCode() As Long
-		Return first Xor length
-	End Function
-
-Private
-	first As Long
-	length As Long
-End Class
+Type CharacterRange
+	First As Long
+	Length As Long
+End Type
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Color.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Color.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Color.ab	(revision 698)
@@ -4,307 +4,5 @@
 Namespace Drawing
 
-Class Color
-Public
-	Sub Color()
-		argb = MakeARGB(255, 0, 0, 0) ' Black
-	End Sub
-
-	Sub Color(ByRef c As Color)
-		argb = c.argb
-	End Sub
-
-	Sub Color(r As Byte, g As Byte, b As Byte)
-		argb = MakeARGB(255, r, g, b)
-	End Sub
-
-	Sub Color(a As Byte, r As Byte, g As Byte, b As Byte)
-		argb = MakeARGB(a, r, g, b)
-	End Sub
-
-	Sub Color(newArgb As System.Drawing.Imaging.ARGB)
-		argb = newArgb
-	End Sub
-
-	Function Operator ==(c As Color) As Boolean
-		Return Equals(c)
-	End Function
-
-	Function Operator <>(c As Color) As Boolean
-		Return Not Equals(c)
-	End Function
-
-	Function A() As Byte
-		A = (argb >> System.Drawing.Imaging.ALPHA_SHIFT) As Byte
-	End Function
-
-	Function R() As Byte
-		R = (argb >> System.Drawing.Imaging.RED_SHIFT) As Byte
-	End Function
-
-	Function G() As Byte
-		G = (argb >> System.Drawing.Imaging.GREEN_SHIFT) As Byte
-	End Function
-
-	Function B() As Byte
-		B = (argb >> System.Drawing.Imaging.BLUE_SHIFT) As Byte
-	End Function
-
-	Function Value() As System.Drawing.Imaging.ARGB
-		Value = argb
-	End Function
-
-	Sub Value(value As System.Drawing.Imaging.ARGB)
-		argb = value
-	End Sub
-
-	Sub SetFromCOLORREF(rgb As COLORREF)
-		If (rgb And &hff000000) = &h01000000 Then
-			Exit Sub ' パレットインデックス指定は無効
-		Else
-			argb = MakeARGB(255, GetRValue(rgb) As Byte, GetGValue(rgb) As Byte, GetBValue(rgb) As Byte)
-		End If
-	End Sub
-
-	Function ToCOLORREF() As COLORREF
-		ToCOLORREF = RGB(R, G, B)
-	End Function
-/*
-	Function ToArgb() As ARGB
-		ToArgb = argb
-	End Function
-*/
-	Static Function FromArgb(argb As System.Drawing.Imaging.ARGB) As Color
-		Return New Color(argb)
-	End Function
-
-	Static Function FromArgb(a As Byte, base As Color) As Color
-		Return New Color(a, base.R, base.G, base.B)
-	End Function
-
-	Static Function FromArgb(r As Byte, g As Byte, b As Byte) As Color
-		Return New Color(r, g, b)
-	End Function
-
-	Static Function FromArgb(a As Byte, r As Byte, g As Byte, b As Byte) As Color
-		Return New Color(a, r, g, b)
-	End Function
-
-	Override Function GetHashCode() As Long
-		Return argb As Long
-	End Function
-
-	Function Equals(c As Color) As Boolean
-		Return argb = c.argb
-	End Function
-
-	' HSBを求める式はhttp://ofo.jp/osakana/cgtips/hsb.phtmlを参考にしました。
-	Function GetHue() As Single
-		Dim max As Long, min As Long, d As Long
-		Dim r = R
-		Dim g = G
-		Dim b = B
-		max = System.Math.Max(System.Math.Max(r, g), b)
-		min = System.Math.Min(System.Math.Min(r, g), b)
-		d = max - min
-		If g = max Then
-			Return ((b - r) As Double / d * 60.0 + 120.0) As Single
-		ElseIf b = max Then
-			Return ((r - g) As Double / d * 60 + 240) As Single
-		ElseIf g < b Then
-			Return ((g - b) As Double / d * 60 + 360) As Single
-		Else
-			Return ((g - b) As Double / d * 60) As Single
-		EndIf
-	End Function
-
-	Function GetSaturation() As Single
-		Dim r = R
-		Dim g = G
-		Dim b = B
-		Dim max = System.Math.Max(System.Math.Max(r, g), b) As Long
-		Dim min = System.Math.Min(System.Math.Min(r, g), b) As Long
-		Return ( (max - min) / max ) As Single
-	End Function
-
-	Function GetBrightness() As Single
-		Dim r = R
-		Dim g = G
-		Dim b = B
-		Dim max = System.Math.Max(System.Math.Max(r, g), b)
-		Return ( max * (1 / 255) ) As Single
-	End Function
-
-/*
-	' Common color constants
-	Const Enum
-		AliceBlue            = &hFFF0F8FF
-		AntiqueWhite         = &hFFFAEBD7
-		Aqua                 = &hFF00FFFF
-		Aquamarine           = &hFF7FFFD4
-		Azure                = &hFFF0FFFF
-		Beige                = &hFFF5F5DC
-		Bisque               = &hFFFFE4C4
-		Black                = &hFF000000
-		BlanchedAlmond       = &hFFFFEBCD
-		Blue                 = &hFF0000FF
-		BlueViolet           = &hFF8A2BE2
-		Brown                = &hFFA52A2A
-		BurlyWood            = &hFFDEB887
-		CadetBlue            = &hFF5F9EA0
-		Chartreuse           = &hFF7FFF00
-		Chocolate            = &hFFD2691E
-		Coral                = &hFFFF7F50
-		CornflowerBlue       = &hFF6495ED
-		Cornsilk             = &hFFFFF8DC
-		Crimson              = &hFFDC143C
-		Cyan                 = &hFF00FFFF
-		DarkBlue             = &hFF00008B
-		DarkCyan             = &hFF008B8B
-		DarkGoldenrod        = &hFFB8860B
-		DarkGray             = &hFFA9A9A9
-		DarkGreen            = &hFF006400
-		DarkKhaki            = &hFFBDB76B
-		DarkMagenta          = &hFF8B008B
-		DarkOliveGreen       = &hFF556B2F
-		DarkOrange           = &hFFFF8C00
-		DarkOrchid           = &hFF9932CC
-		DarkRed              = &hFF8B0000
-		DarkSalmon           = &hFFE9967A
-		DarkSeaGreen         = &hFF8FBC8B
-		DarkSlateBlue        = &hFF483D8B
-		DarkSlateGray        = &hFF2F4F4F
-		DarkTurquoise        = &hFF00CED1
-		DarkViolet           = &hFF9400D3
-		DeepPink             = &hFFFF1493
-		DeepSkyBlue          = &hFF00BFFF
-		DimGray              = &hFF696969
-		DodgerBlue           = &hFF1E90FF
-		Firebrick            = &hFFB22222
-		FloralWhite          = &hFFFFFAF0
-		ForestGreen          = &hFF228B22
-		Fuchsia              = &hFFFF00FF
-		Gainsboro            = &hFFDCDCDC
-		GhostWhite           = &hFFF8F8FF
-		Gold                 = &hFFFFD700
-		Goldenrod            = &hFFDAA520
-		Gray                 = &hFF808080
-		Green                = &hFF008000
-		GreenYellow          = &hFFADFF2F
-		Honeydew             = &hFFF0FFF0
-		HotPink              = &hFFFF69B4
-		IndianRed            = &hFFCD5C5C
-		Indigo               = &hFF4B0082
-		Ivory                = &hFFFFFFF0
-		Khaki                = &hFFF0E68C
-		Lavender             = &hFFE6E6FA
-		LavenderBlush        = &hFFFFF0F5
-		LawnGreen            = &hFF7CFC00
-		LemonChiffon         = &hFFFFFACD
-		LightBlue            = &hFFADD8E6
-		LightCoral           = &hFFF08080
-		LightCyan            = &hFFE0FFFF
-		LightGoldenrodYellow = &hFFFAFAD2
-		LightGray            = &hFFD3D3D3
-		LightGreen           = &hFF90EE90
-		LightPink            = &hFFFFB6C1
-		LightSalmon          = &hFFFFA07A
-		LightSeaGreen        = &hFF20B2AA
-		LightSkyBlue         = &hFF87CEFA
-		LightSlateGray       = &hFF778899
-		LightSteelBlue       = &hFFB0C4DE
-		LightYellow          = &hFFFFFFE0
-		Lime                 = &hFF00FF00
-		LimeGreen            = &hFF32CD32
-		Linen                = &hFFFAF0E6
-		Magenta              = &hFFFF00FF
-		Maroon               = &hFF800000
-		MediumAquamarine     = &hFF66CDAA
-		MediumBlue           = &hFF0000CD
-		MediumOrchid         = &hFFBA55D3
-		MediumPurple         = &hFF9370DB
-		MediumSeaGreen       = &hFF3CB371
-		MediumSlateBlue      = &hFF7B68EE
-		MediumSpringGreen    = &hFF00FA9A
-		MediumTurquoise      = &hFF48D1CC
-		MediumVioletRed      = &hFFC71585
-		MidnightBlue         = &hFF191970
-		MintCream            = &hFFF5FFFA
-		MistyRose            = &hFFFFE4E1
-		Moccasin             = &hFFFFE4B5
-		NavajoWhite          = &hFFFFDEAD
-		Navy                 = &hFF000080
-		OldLace              = &hFFFDF5E6
-		Olive                = &hFF808000
-		OliveDrab            = &hFF6B8E23
-		Orange               = &hFFFFA500
-		OrangeRed            = &hFFFF4500
-		Orchid               = &hFFDA70D6
-		PaleGoldenrod        = &hFFEEE8AA
-		PaleGreen            = &hFF98FB98
-		PaleTurquoise        = &hFFAFEEEE
-		PaleVioletRed        = &hFFDB7093
-		PapayaWhip           = &hFFFFEFD5
-		PeachPuff            = &hFFFFDAB9
-		Peru                 = &hFFCD853F
-		Pink                 = &hFFFFC0CB
-		Plum                 = &hFFDDA0DD
-		PowderBlue           = &hFFB0E0E6
-		Purple               = &hFF800080
-		Red                  = &hFFFF0000
-		RosyBrown            = &hFFBC8F8F
-		RoyalBlue            = &hFF4169E1
-		SaddleBrown          = &hFF8B4513
-		Salmon               = &hFFFA8072
-		SandyBrown           = &hFFF4A460
-		SeaGreen             = &hFF2E8B57
-		SeaShell             = &hFFFFF5EE
-		Sienna               = &hFFA0522D
-		Silver               = &hFFC0C0C0
-		SkyBlue              = &hFF87CEEB
-		SlateBlue            = &hFF6A5ACD
-		SlateGray            = &hFF708090
-		Snow                 = &hFFFFFAFA
-		SpringGreen          = &hFF00FF7F
-		SteelBlue            = &hFF4682B4
-		Tan                  = &hFFD2B48C
-		Teal                 = &hFF008080
-		Thistle              = &hFFD8BFD8
-		Tomato               = &hFFFF6347
-		Transparent          = &h00FFFFFF
-		Turquoise            = &hFF40E0D0
-		Violet               = &hFFEE82EE
-		Wheat                = &hFFF5DEB3
-		White                = &hFFFFFFFF
-		WhiteSmoke           = &hFFF5F5F5
-		Yellow               = &hFFFFFF00
-		YellowGreen          = &hFF9ACD32
-	End Enum
-
-	' Shift count and bit mask for A, R, G, B components
-
-	Const Enum
-		AlphaShift  = 24
-		RedShift    = 16
-		GreenShift  = 8
-		BlueShift   = 0
-	End Enum
-
-	Const Enum
-		AlphaMask   = &hff000000
-		RedMask     = &h00ff0000
-		GreenMask   = &h0000ff00
-		BlueMask    = &h000000ff
-	End Enum
-*/
-	Static Function MakeARGB(a As Byte, r As Byte, g As Byte, b As Byte) As System.Drawing.Imaging.ARGB
-		MakeARGB = (((b As System.Drawing.Imaging.ARGB) <<  System.Drawing.Imaging.BLUE_SHIFT) Or _
-		            ((g As System.Drawing.Imaging.ARGB) << System.Drawing.Imaging.GREEN_SHIFT) Or _
-		            ((r As System.Drawing.Imaging.ARGB) <<   System.Drawing.Imaging.RED_SHIFT) Or _
-		            ((a As System.Drawing.Imaging.ARGB) << System.Drawing.Imaging.ALPHA_SHIFT))
-	End Function
-
-Protected
-	argb As System.Drawing.Imaging.ARGB
-End Class
+TypeDef Color = DWord 'ARGB
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Drawing2D/Matrix.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Drawing2D/Matrix.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Drawing2D/Matrix.ab	(revision 698)
@@ -5,4 +5,12 @@
 
 Class Matrix
+Public
+	Sub Matrix(native As *GpMatrix)
+		nativeMatrix = native
+	End Sub 
+	Function NativeMatrix() As *GpMatrix
+		NativeMatrix = nativeMatrix
+	End Function
+	nativeMatrix As *GpMatrix
 End Class
 
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Drawing2D/misc.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Drawing2D/misc.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Drawing2D/misc.ab	(revision 698)
@@ -3,4 +3,7 @@
 Namespace Drawing
 Namespace Drawing2D
+	
+TypeDef GraphicsContainer = DWord
+TypeDef GraphicsState = DWord
 
 Enum CombineMode
@@ -85,4 +88,54 @@
 End Enum
 
+Enum DashStyle
+	Solid           ' 0
+	Dash            ' 1
+	Dot             ' 2
+	DashDot         ' 3
+	DashDotDot      ' 4
+	Custom          ' 5
+End Enum
+
+Enum DashCap
+	Flat             = 0
+	Round            = 2
+	Triangle         = 3
+End Enum
+
+Enum LineCap
+	Flat             = 0
+	Square           = 1
+	Round            = 2
+	Triangle         = 3
+	NoAnchor         = &h10
+	SquareAnchor     = &h11
+	RoundAnchor      = &h12
+	DiamondAnchor    = &h13
+	ArrowAnchor      = &h14
+	Custom           = &hff
+	AnchorMask       = &hf0
+End Enum
+
+Enum LineJoin
+	Miter = 0
+	Bevel = 1
+	Round = 2
+	Clipped = 3
+End Enum
+
+Enum PenAlignment
+	Center       = 0
+	Inset        = 1
+End Enum
+
+Enum PenType
+	SolidColor       = 0 'BrushTypeSolidColor
+	HatchFill        = 1 'BrushTypeHatchFill
+	TextureFill      = 2 'BrushTypeTextureFill
+	PathGradient     = 3 'BrushTypePathGradient
+	LinearGradient   = 4 'BrushTypeLinearGradient
+	Unknown          = -1
+End Enum
+
 End Namespace
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Font.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Font.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Font.ab	(revision 698)
@@ -1,5 +1,4 @@
 Namespace System
 Namespace Drawing
-
 
 /**
@@ -8,177 +7,137 @@
 */
 
-Class FontFamily : End Class
-Class FontCollection : End Class
+Class FontCollection
+Public
+	nativeCollection As *GpFontCollection
+End Class
 
 Class Font
 	Implements System.IDisposable
 Public
-'	 friend class Graphics
-
-	Sub Font(/*IN*/ hdc As HDC)
+	Static Function FromHDC(/*IN*/ hdc As HDC) As Font
 		Dim font = 0 As *GpFont
-		lastResult = GdipCreateFontFromDC(hdc, font)
-		SetNativeFont(font)
-	End Sub
-
-	Sub Font(/*IN*/ hdc As HDC, /*IN const*/ ByRef logfont As LOGFONTA)
+		SetStatus(GdipCreateFontFromDC(hdc, font))
+		FromHDC = New Font(font)
+	End Function
+
+	Static Function FromLogFont(/*IN*/ hdc As HDC, /*IN const*/ ByRef logfont As LOGFONTA) As Font
 		Dim font = 0 As *GpFont
-		lastResult =GdipCreateFontFromLogfontA(hdc, logfont, font)
-		SetNativeFont(font)
-	End Sub
-
-	Sub Font(/*IN*/ hdc As HDC, /*IN const*/ ByRef logfont As LOGFONTW)
+		SetStatus(GdipCreateFontFromLogfontA(hdc, logfont, font))
+		FromLogFont = New Font(font)
+	End Function
+
+	Static Function FromLogFont(/*IN*/ hdc As HDC, /*IN const*/ ByRef logfont As LOGFONTW) As Font
 		Dim font = 0 As *GpFont
-		lastResult =GdipCreateFontFromLogfontW(hdc, logfont, font)
-		SetNativeFont(font)
-	End Sub
-
-	Sub Font(/*IN*/ hdc As HDC, /*IN const*/ hfont As HFONT)
+		SetStatus(GdipCreateFontFromLogfontW(hdc, logfont, font))
+		FromLogFont = New Font(font)
+	End Function
+
+	Static Function FromHFont(/*IN*/ hdc As HDC, /*IN const*/ hfont As HFONT) As Font
 		Dim font = 0 As *GpFont
 		If hfont <> 0 Then
 			Dim lf As LOGFONTA
-			If GetObjectA(hfont, sizeof (LOGFONTA), lf) <> 0 Then
-				lastResult = GdipCreateFontFromLogfontA(hdc, lf, font)
+			If GetObjectA(hfont, Len(lf), lf) <> 0 Then
+				SetStatus(GdipCreateFontFromLogfontA(hdc, lf, font))
 			Else
-				lastResult = GdipCreateFontFromDC(hdc, font)
+				SetStatus(GdipCreateFontFromDC(hdc, font))
 			End If
 		Else
-			lastResult = GdipCreateFontFromDC(hdc, font)
-		End If
-		SetNativeFont(font)
+			SetStatus(GdipCreateFontFromDC(hdc, font))
+		End If
+		FromHFont = New Font(font)
+	End Function
+
+	Sub Font(f As *GpFont)
+		nativeFont = f
 	End Sub
 
 	Sub Font(/*IN const*/ family As FontFamily, /*IN*/ emSize As Single)
-		Font(family, emSize, FontStyleRegular, UnitPoint)
-	End Sub
-
-	Sub Font(/*IN const*/ family As FontFamily,
-		/*IN*/ emSize As Single, /*IN*/ style As Long)
-
-		Font(family, emSize, style, UnitPoint)
+		initFont(family, emSize, FontStyle.Regular, GraphicsUnit.Point)
+	End Sub
+
+	Sub Font(/*IN const*/ family As FontFamily, /*IN*/ emSize As Single, /*IN*/ style As FontStyle)
+		initFont(family, emSize, style, GraphicsUnit.Point)
+	End Sub
+
+	Sub Font(/*IN const*/ family As FontFamily, /*IN*/ emSize As Single, /*IN*/ unit As GraphicsUnit)
+		initFont(family, emSize, FontStyle.Regular, unit)
 	End Sub
 
 	Sub Font(/*IN const*/ family As FontFamily, /*IN*/ emSize As Single,
-		/*IN*/ style As Long, /*IN*/ unit As GraphicsUnit)
-
-		Dim font = 0 As *GpFont
-		lastResult = GdipCreateFont(
-			family.NativeFamily, emSize, style, unit, font)
-		SetNativeFont(font)
+		/*IN*/ style As FontStyle, /*IN*/ unit As GraphicsUnit)
+
+		initFont(family, emSize, style, unit)
 	End Sub
 
 	Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single)
-		Font(familyName, emSize, FontStyleRegular, Unit.Point, ByVal 0)
+		initFromName(familyName, emSize, FontStyle.Regular, GraphicsUnit.Point, Nothing)
 	End Sub
 
 	Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single)
-		Font(familyName, emSize, FontStyleRegular, Unit.Point, ByVal 0)
+		initFromName(ToWCStr(familyName), emSize, FontStyle.Regular, GraphicsUnit.Point, Nothing)
+	End Sub
+
+	Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single, /*IN*/ style As FontStyle)
+		initFromName(familyName, emSize, style, GraphicsUnit.Point, Nothing)
+	End Sub
+
+	Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single, /*IN*/ style As FontStyle)
+		initFromName(ToWCStr(familyName), emSize, style, GraphicsUnit.Point, Nothing)
+	End Sub
+
+	Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single, /*IN*/ unit As GraphicsUnit)
+		initFromName(familyName, emSize, FontStyle.Regular, unit, Nothing)
+	End Sub
+
+	Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single, /*IN*/ unit As GraphicsUnit)
+		initFromName(ToWCStr(familyName), emSize, FontStyle.Regular, unit, Nothing)
 	End Sub
 
 	Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single,
-		 /*IN*/ style As Long)
-		Font(familyName, emSize, style, Unit.Point, ByVal 0)
+		 /*IN*/ style As FontStyle, /*IN*/ unit As GraphicsUnit)
+
+		initFromName(familyName, emSize, style, unit, Nothing)
 	End Sub
 
 	Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single,
-		 /*IN*/ style As Long)
-		Font(familyName, emSize, style, Unit.Point, ByVal 0)
+		 /*IN*/ style As FontStyle, /*IN*/ unit As GraphicsUnit)
+
+		initFromName(ToWCStr(familyName), emSize, style, unit, Nothing)
 	End Sub
 
 	Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single,
-		 /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit)
-		Font(familyName, emSize, style, unit, ByVal 0)
+		/*IN*/ style As FontStyle, /*IN*/ unit As GraphicsUnit,
+		/*IN const*/ fontCollection As FontCollection)
+
+		initFromName(familyName, emSize, style, unit, fontCollection)
 	End Sub
 
 	Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single,
-		 /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit)
-		Font(familyName, emSize, style, unit, ByVal 0)
-	End Sub
-
-	Sub Font(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single,
-		/*IN*/ style As Long, /*IN*/ unit As GraphicsUnit,
-		/*IN const*/ ByRef fontCollection As FontCollection)
-
-		nativeFont = 0
-
-		Dim family As FontFamily(familyName, fontCollection)
-		Dim nativeFamily = family.NativeFamily As *GpFontFamily
-
-		lastResult = family.GetLastStatus()
-
-		If lastResult <> Ok Then
-			nativeFamily = FontFamily.GenericSansSerif()->NativeFamily
-			lastResult = FontFamily.GenericSansSerif()->lastResult
-			If lastResult <> Ok Then
-				Exit Sub
-			End If
-		End If
-
-		lastResult = GdipCreateFont(
-			nativeFamily, emSize, style, unit, nativeFont)
-
-		If lastResult <> Ok Then
-			nativeFamily = FontFamily.GenericSansSerif()->NativeFamily
-			lastResult = FontFamily.GenericSansSerif()->lastResult
-			If lastResult <> Ok Then
-				Exit Sub
-			End If
-
-			lastResult = GdipCreateFont(
-				nativeFamily, emSize, style, unit, nativeFont)
-		End If
-	End Sub
-
-	Sub Font(/*IN const*/ familyName As String, /*IN*/ emSize As Single,
-		/*IN*/ style As Long, /*IN*/ unit As GraphicsUnit,
+		/*IN*/ style As FontStyle, /*IN*/ unit As GraphicsUnit,
 		/*IN const*/ fontCollection As FontCollection)
-		Font(ToWCStr(familyName), emSize, style, unit, fontCollection)
-	End Sub
-
-	Const Function GetLogFontA(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONTA) As Status
-		Dim nativeGraphics As *GpGraphics
-		If Not ActiveBasic.IsNothing(g) Then
-			nativeGraphics = g.nativeGraphics
-		End If
-		Return SetStatus(GdipGetLogFontA(nativeFont, nativeGraphics, lf))
-	End Function
-
-	Const Function GetLogFontW(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONTW) As Status
-		Dim nativeGraphics As *GpGraphics
-		If Not ActiveBasic.IsNothing(g) Then
-			nativeGraphics = g.nativeGraphics
-		End If
-		Return SetStatus(GdipGetLogFontW(nativeFont, nativeGraphics, lf))
-	End Function
-
-	Const Function GetLogFont(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONT) As Status
-		Dim nativeGraphics As *GpGraphics
-		If Not ActiveBasic.IsNothing(g) Then
-			nativeGraphics = g.nativeGraphics
-		End If
-#ifdef UNICODE
-		Return SetStatus(GdipGetLogFontW(nativeFont, nativeGraphics, lf))
-#else
-		Return SetStatus(GdipGetLogFontA(nativeFont, nativeGraphics, lf))
-#endif
-	End Function
+
+		initFromName(ToWCStr(familyName), emSize, style, unit, fontCollection)
+	End Sub
 
 	Const Function Clone() As Font
 		Dim cloneFont = 0 As *GpFont
 		SetStatus(GdipCloneFont(nativeFont, cloneFont))
-		Return New Font(cloneFont, lastResult)
-	End Function
+		Clone = New Font(cloneFont)
+	End Function
+
+	Sub Dispose()
+		If nativeFont <> 0 Then
+			GdipDeleteFont(nativeFont)
+		End If
+		nativeFont = 0
+	End Sub
 
 	Sub ~Font()
-		GdipDeleteFont(nativeFont)
-	End Sub
-
-	Const Function IsAvailable() As Boolean
-		Return nativeFont <> 0
-	End Function
-
-	Const Function Style() As Long
-		SetStatus(GdipGetFontStyle(nativeFont, Style))
-	End Function
+		Dispose()
+	End Sub
+
+'	Const Function Style() As FontStyle
+'		SetStatus(GdipGetFontStyle(nativeFont, Style))
+'	End Function
 
 	Const Function Size() As Single
@@ -186,16 +145,13 @@
 	End Function
 
-	Const Function SizeInPoints() As Single
-
-	Const Function Unit() As GraphicsUnit
-		SetStatus(GdipGetFontUnit(nativeFont, Unit))
-	End Function
-
-	Const Function LastStatus() As Status
-		Return lastResult
-	End Function
+'	Const Function SizeInPoints() As Single
+'	End Function
+
+'	Const Function Unit() As GraphicsUnit
+'		SetStatus(GdipGetFontUnit(nativeFont, Unit))
+'	End Function
 
 	Const Function Height() As Long
-		Return GetHeight() As Long
+		Height = GetHeight() As Long
 	End Function
 
@@ -205,8 +161,5 @@
 
 	Const Function GetHeight(/*IN const*/ g As Graphics) As Single
-		Dim nativeGraphics As *GpGraphics
-		If Not ActiveBasic.IsNothing(g) Then
-			nativeGraphics = g.NativeGraphics
-		End If
+		Dim nativeGraphics = getNativeGraphics(g)
 		SetStatus(GdipGetFontHeight(nativeFont, nativeGraphics, GetHeight))
 	End Function
@@ -216,16 +169,13 @@
 	End Function
 
-'	 Const Function FontFamily(/*OUT*/ ByRef family As FontFamily)
-'		If VarPtr(family) = 0 Then
-'			Return SetStatus(Status.InvalidParameter)
-'		End If
-'		Dim status = GdipGetFamily(nativeFont, family->nativeFamily)
-'		family->SetStatus(status)
-'		Return SetStatus(status)
+'	 Const Function FontFamily() As FontFamily
+'		Dim nativeFamily As *GpFamily
+'		SetStatus(GdipGetFamily(nativeFont, nativeFamily))
+'		FontFamily = New FontFamily(nativeFamily)
 '	End Function
 
 	Const Function Bold() As Boolean
 		Dim lf As LOGFONT
-		GetLogFont(0, lf)
+		ToLogFont(lf)
 		Return lf.lfWeight > FW_BOLD
 	End Function
@@ -233,5 +183,5 @@
 	Const Function GdiCharSet() As Byte
 		Dim lf As LOGFONT
-		GetLogFont(0, lf)
+		ToLogFont(lf)
 		Return lf.lfCharSet
 	End Function
@@ -239,42 +189,41 @@
 	'Const Function GdiVerticalFont() As Boolean
 
-	Const Function NativeFont() As *GpFont
-		Return nativeFont
-	End Function
-
 	'Const Function IsSystemFont() As Boolean
 
 	Const Function Italic() As Boolean
 		Dim lf As LOGFONT
-		GetLogFont(0, lf)
-		Return lf.lfItalic <> FALSE
+		ToLogFont(lf)
+		Italic = lf.lfItalic <> FALSE
 	End Function
 
 	Const Function Name() As String
-#ifdef UNICODE
-		Dim lf As LOGFONTW
-		GetLogFontW(0, lf)
-#else
-		Dim lf As LOGFONTA
-		GetLogFontA(0, lf)
-#endif
-		Return lf.lfFaceName
-	End Function
-
-	'Const Function SizeInPoint() As Boolean
+		Dim lf As LOGFONT
+		ToLogFont(lf)
+		Dim p = lf.lfFaceName As PCTSTR
+		Name = New String(p)
+	End Function
 
 	Const Function StrikeOut() As Boolean
 		Dim lf As LOGFONT
-		GetLogFont(0, lf)
-		Return lf.fdwStrikeOut <> FALSE
+		ToLogFont(lf)
+		StrikeOut = lf.lfStrikeOut <> FALSE
 	End Function
 
 	Const Function Style() As FontStyle
 		Dim lf As LOGFONT
-		GetLogFont(0, lf)
-		Return (((lf.lfWeight > FW_BOLD) And FontStyle.Bold) Or _
-			((lf.lfItatlic <> FALSE) And FontStyle.Italic) Or _
-			((lf.fdwStrikeOut <> FALSE) And FontStyle.Strickeout) Or _
-			((lf.fdwUnderline <> FALSE) And FontStyle.Underline)) As FontStyle
+		ToLogFont(lf)
+		Style = FontStyle.Regular
+		If lf.lfWeight > FW_BOLD Then
+			Style Or= FontStyle.Bold
+		End If
+		If lf.lfItalic <> FALSE Then
+			Style Or= FontStyle.Italic
+		End If
+		If lf.lfStrikeOut <> FALSE Then
+			Style Or= FontStyle.Strikeout
+		End If
+		If lf.lfUnderline <> FALSE Then
+			Style Or= FontStyle.Underline
+		End If
 	End Function
 
@@ -283,51 +232,80 @@
 	Const Function Underline() As Boolean
 		Dim lf As LOGFONT
-		GetLogFont(0, lf)
-		Return lf.fdwUnderline <> FALSE
+		ToLogFont(lf)
+		Underline = lf.lfUnderline <> FALSE
 	End Function
 
 	Override Function ToString() As String
-		Return Name
+		ToString = Name
 	End Function
 
 	Const Function ToHfont() As HFONT
 		Dim lf As LOGFONT
-		GetLogFont(ByVal 0, lf)
-		Return CreateFontIndirect(lf)
-	End Function
-
-	Const Sub ToLogFont(ByRef lf As LOGFONT)
-		GetLogFont(ByVal 0, lf)
-	End Sub
-
-	Const Sub ToLogFont(ByRef lf As LOGFONT, g As Graphics)
-		GetLogFont(g, lf)
-	End Sub
+		ToLogFont(lf)
+		ToHfont = CreateFontIndirect(lf)
+	End Function
+
+	Const Sub ToLogFont(/*OUT*/ ByRef lf As LOGFONTA, /*IN const*/ g As Graphics)
+		Dim nativeGraphics = getNativeGraphics(g)
+		SetStatus(GdipGetLogFontA(nativeFont, nativeGraphics, lf))
+	End Sub
+
+	Const Sub ToLogFont(/*OUT*/ ByRef lf As LOGFONTW, /*IN const*/ g As Graphics)
+		Dim nativeGraphics = getNativeGraphics(g)
+		SetStatus(GdipGetLogFontW(nativeFont, nativeGraphics, lf))
+	End Sub
+
+	Const Sub ToLogFont(ByRef lf As LOGFONTA)
+		ToLogFont(lf, Nothing)
+	End Sub
+
+	Const Sub ToLogFont(ByRef lf As LOGFONTW)
+		ToLogFont(lf, Nothing)
+	End Sub
+
+	Function NativeFont() As *GpFont
+		NativeFont = nativeFont
+	End Function
 
 Private
-'	Sub Font(ByRef f As Font)
-
-Protected
-	Sub Font(f As *GpFont, status As Status)
-		lastResult = status
-		SetNativeFont(f)
-	End Sub
-
-	Sub SetNativeFont(f As *GpFont)
-		nativeFont = f
-	End Sub
-
-	Const Function SetStatus(s As Status) As Status
-		If s <> Status.Ok Then
-			lastResult = s
-			Return s
+	Sub initFont(/*IN const*/ family As FontFamily, /*IN*/ emSize As Single,
+		/*IN*/ style As Long, /*IN*/ unit As GraphicsUnit)
+
+		If ActiveBasic.IsNothing(family) Then
+			Throw New ArgumentNullException("family")
+		End If
+		SetStatus(GdipCreateFont(family.NativeFamily, emSize, style, unit, nativeFont))
+	End Sub
+
+	Sub initFromName(/*IN const*/ familyName As PCWSTR, /*IN*/ emSize As Single,
+		/*IN*/ style As Long, /*IN*/ unit As GraphicsUnit, fontCollection As FontCollection)
+
+		nativeFont = 0
+		Dim family = Nothing As FontFamily
+		Dim nativeFamily = family.NativeFamily
+
+		Try
+			family = New FontFamily(familyName, fontCollection)
+		Catch e As Exception
+			nativeFamily = FontFamily.GenericSansSerif().NativeFamily
+		End Try
+
+		Try
+			SetStatus(GdipCreateFont(nativeFamily, emSize, style, unit, nativeFont))
+		Catch e As Exception
+			nativeFamily = FontFamily.GenericSansSerif().NativeFamily
+			SetStatus(GdipCreateFont(nativeFamily, emSize, style, unit, nativeFont))
+		End Try
+	End Sub
+
+	Static Function getNativeGraphics(g As Graphics) As *GpGraphics
+		If ActiveBasic.IsNothing(g) Then
+			getNativeGraphics = 0
 		Else
-			Return s
-		End If
-	End Function
-
-Protected
+			getNativeGraphics = g.NativeGraphics
+		End If
+	End Function
+
 	nativeFont As *GpFont
-	/*mutable*/ lastResult As Status
 End Class
 
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/FontFamily.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/FontFamily.ab	(revision 698)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/FontFamily.ab	(revision 698)
@@ -0,0 +1,118 @@
+' Classes/System/Drawing/FontFamily.ab
+
+Namespace System
+Namespace Drawing
+
+Class FontFamily
+	Implements IDisposable, ICloneable
+Public
+	Sub FontFamily(native As *GpFontFamily)
+		nativeFamily = native
+	End Sub
+
+	Sub FontFamily(/*IN const*/ name As PCWSTR, fontCollection As FontCollection)
+		SetStatus(GdipCreateFontFamilyFromName(name, getNativeCollection(fontCollection), nativeFamily))
+	End Sub
+
+	Static Function GenericSansSerif() As FontFamily
+		If ActiveBasic.IsNothing(GenericSansSerifFontFamily) Then
+			Dim native As *GpFontFamily
+			SetStatus(GdipGetGenericFontFamilySansSerif(native))
+			GenericSansSerifFontFamily = New FontFamily(native)
+		End If
+		GenericSansSerif = GenericSansSerifFontFamily
+	End Function
+
+	Static Function GenericSerif() As FontFamily
+		If ActiveBasic.IsNothing(GenericSerifFontFamily) Then
+			Dim native As *GpFontFamily
+			SetStatus(GdipGetGenericFontFamilySerif(native))
+			GenericSerifFontFamily = New FontFamily(native)
+		End If
+		GenericSerif = GenericSerifFontFamily
+	End Function
+
+	Static Function GenericMonospace() As FontFamily
+		If ActiveBasic.IsNothing(GenericMonospaceFontFamily) Then
+			Dim native As *GpFontFamily
+			SetStatus(GdipGetGenericFontFamilyMonospace(native))
+			GenericMonospaceFontFamily = New FontFamily(native)
+		End If
+		GenericMonospace = GenericMonospaceFontFamily
+	End Function
+
+	Sub Dispose()
+		If nativeFamily <> 0 Then
+			GdipDeleteFontFamily(nativeFamily)
+		End If
+		nativeFamily = 0
+	End Sub
+
+	Sub ~FontFamily()
+		Dispose()
+	End Sub
+
+	Function Clone() As FontFamily
+		Dim cloned As *GpFontFamily
+		SetStatus(GdipCloneFontFamily(nativeFamily, cloned))
+		Clone = New FontFamily(cloned)
+	End Function
+
+	Function GetName(language As LANGID) As String
+		Dim name[ELM(LF_FACESIZE)] As WCHAR
+		SetStatus(GdipGetFamilyName(nativeFamily, name, language))
+		Dim p = name As PCWSTR
+		GetName = New String(p)
+	End Function
+
+	Function IsStyleAvailable(style As FontStyle) As Boolean
+		Dim StyleAvailable As BOOL
+		SetStatus(GdipIsStyleAvailable(nativeFamily, style, StyleAvailable))
+		IsStyleAvailable = StyleAvailable As Boolean
+	End Function
+
+	Function GetEmHeight(style As FontStyle) As Word
+		SetStatus(GdipGetEmHeight(nativeFamily, style, GetEmHeight))
+	End Function
+/*
+	Function GetCellAscent(style As FontStyle) As Word
+		SetStatus(GdipGetCellAscent(nativeFamily, style, GetEmHeight))
+	End Function
+
+	Function GetCellDescent(style As FontStyle) As Word
+		SetStatus(GdipGetCellDescent(nativeFamily, style, GetEmHeight))
+	End Function
+
+
+	Function GetLineSpacing(style As FontStyle) As Word
+		SetStatus(GdipGetLineSpacing(nativeFamily, style, GetEmHeight))
+	End Function
+*/
+	' Familes
+
+	Function NativeFamily() As *GpFontFamily
+		NativeFamily = nativeFamily
+	End Function
+
+Private
+
+	nativeFamily As *GpFontFamily
+
+	Static Function getNativeCollection(fc As FontCollection) As *GpFontCollection
+		If ActiveBasic.IsNothing(fc) Then
+			getNativeCollection = 0
+		Else
+			getNativeCollection = fc.nativeCollection
+		End If
+	End Function
+
+	Static GenericSansSerifFontFamily = Nothing As FontFamily
+	Static GenericSerifFontFamily = Nothing As FontFamily
+	Static GenericMonospaceFontFamily = Nothing As FontFamily
+
+End Class
+
+
+
+End Namespace
+End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Graphics.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Graphics.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Graphics.ab	(revision 698)
@@ -4,13 +4,54 @@
 Namespace Drawing
 
-Class Brush : End Class
-Class Pen : End Class
-Class StringFormat : End Class
-Class Image : End Class
-Class ImageAttributes : End Class
-Class Metafile : End Class
-Class Region : End Class
-Class GraphicsPath : End Class
-Class CachedBitmap : End Class
+Class Brush
+Public
+	nativeBrush As *GpBrush
+End Class
+Class StringFormat
+Public
+	nativeFormat As *GpStringFormat	
+End Class
+Class Image
+Public
+	nativeImage As *GpImage
+End Class
+Class ImageAttributes
+Public
+	nativeImage As *GpImageAttributes
+End Class
+Class Metafile
+Inherits Image
+End Class
+Class Region
+Public
+	nativeRegion As *GpRegion
+End Class
+Class GraphicsPath
+Public
+	nativePath As *GpPath
+End Class
+Class CachedBitmap
+Public
+	nativeCachedBitmap As *GpCachedBitmap
+End Class
+
+Delegate Function EnumerateMetafileProc(recordType As EmfPlusRecordType, flags As DWord, dataSize As DWord, data As *Byte, callbackData As VoidPtr) As Boolean
+
+Namespace Detail
+
+TypeDef NativeEnumerateMetafileProc = *Function(recordType As EmfPlusRecordType, flags As DWord, dataSize As DWord, data As *Byte, callbackData As VoidPtr) As Boolean
+
+Type EnumerateMetafileProcData
+	Proc As EnumerateMetafileProc
+	Data As VoidPtr
+End Type
+
+Function NativeEnumerateMetafileProcEntry(recordType As EmfPlusRecordType, flags As DWord, dataSize As DWord, data As *Byte, callbackData As VoidPtr) As Boolean
+	Dim procData = callbackData As *EnumerateMetafileProcData
+	Dim proc = procData->Proc
+	NativeEnumerateMetafileProcEntry = proc(recordType, flags, dataSize, data, procData->Data)
+End Function
+
+End Namespace
 
 Class Graphics
@@ -20,147 +61,142 @@
 	'=========================================================================
 	Const Function Clip() As Region
-		Dim r As Region
-		GetClip(r)
-		Return r
-	End Function
-
-	Sub Clip(region As /*Const*/ Region)
-		SetClip(region, CombineMode.Replace)
+		Clip = New Region
+		SetStatus(GdipGetClip(nativeGraphics, Clip.nativeRegion))
+	End Function
+
+	Sub Clip(region As Region)
+		Imports System.Drawing.Drawing2D
+		SetStatus(GdipSetClipRegion(nativeGraphics, region.nativeRegion, CombineMode.Replace))
 	End Sub
 
 	Const Function ClipBounds() As RectangleF
-		Dim rc As RectangleF
-		GetClipBounds(rc)
-		Return rc
-	End Function
-
-	Sub ClipBounds(rc As RectangleF)
-		SetClipBounds(rc)
-	End Sub
-
-	Function CompositingMode() As CompositingMode
-		Return GetCompositingMode()
-	End Function
-
-	Sub CompositingMode(mode As CompositingMode)
-		SetCompositingMode(mode)
-	End Sub
-
-	Function CompositingQuality() As CompositingQuality
-		Return GetCompositingQuality()
-	End Function
-
-	Sub CompositingQuality(cq As CompositingQuality)
-		SetCompositingQuality(cq)
-	End Sub
-
+		SetStatus(GdipGetClipBounds(nativeGraphics, ClipBounds))
+	End Function
+
+	Const Function ClipBoundsI() As Rectangle
+		SetStatus(GdipGetClipBoundsI(nativeGraphics, ClipBoundsI))
+	End Function
+/*
+	Const Function CompositingMode() As Drawing2D.CompositingMode
+		SetStatus(GdipGetCompositingMode(nativeGraphics, CompositingMode))
+	End Function
+
+	Sub CompositingMode(mode As Drawing2D.CompositingMode)
+		SetStatus(GdipSetCompositingMode(nativeGraphics, mode))
+	End Sub
+
+	Function CompositingQuality() As Drawing2D.CompositingQuality
+		SetStatus(GdipGetCompositingQuality(nativeGraphics, CompositingQuality))
+	End Function
+
+	Sub CompositingQuality(cq As Drawing2D.CompositingQuality)
+		Return SetStatus(GdipSetCompositingQuality(nativeGraphics, cq))
+	End Sub
+*/
 	Const Function DpiX() As Single
-		Dim dpi As Single
-		SetStatus(GdipGetDpiX(nativeGraphics, dpi))
-		Return dpi
+		SetStatus(GdipGetDpiX(nativeGraphics, DpiX))
 	End Function
 
 	Const Function DpiY() As Single
-		Dim dpi As Single
-		SetStatus(GdipGetDpiY(nativeGraphics, dpi))
-		Return dpi
-	End Function
-
-	Const Function InterpolationMode() As InterpolationMode
-		Return GetInterpolationMode()
-	End Function
-
-	Sub InterpolationMode(im As InterpolationMode)
-		SetInterpolationMode(im)
-	End Sub
-
-	Const Function IsClipEmpty() As BOOL
+		SetStatus(GdipGetDpiY(nativeGraphics, DpiY))
+	End Function
+/*
+	Const Function InterpolationMode() As Drawing2D.InterpolationMode
+		SetStatus(GdipGetInterpolationMode(nativeGraphics, InterpolationMode))
+	End Function
+
+	Sub InterpolationMode(im As Drawing2D.InterpolationMode)
+		InterpolationMode = SetStatus(GdipSetInterpolationMode(nativeGraphics, im))
+	End Sub
+*/
+	Const Function IsClipEmpty() As Boolean
 		Dim b = FALSE As BOOL
 		SetStatus(GdipIsClipEmpty(nativeGraphics, b))
-		Return b
-	End Function
-
-	Const Function IsVisibleClipEmpty() As BOOL
+		IsClipEmpty = b As Boolean
+	End Function
+
+	Const Function IsVisibleClipEmpty() As Boolean
 		Dim b = FALSE As BOOL
 		SetStatus(GdipIsVisibleClipEmpty(nativeGraphics, b))
-		Return b
-	End Function
-
-	Function PageScale(scale As Single) As Status
-		Return SetStatus(GdipSetPageScale(nativeGraphics, scale))
-	End Function
+		IsVisibleClipEmpty = b As Boolean
+	End Function
+
+	Sub PageScale(scale As Single)
+		SetStatus(GdipSetPageScale(nativeGraphics, scale))
+	End Sub
 
 	Const Function PageScale() As Single
-		Dim scale As Single
-		SetStatus(GdipGetPageScale(nativeGraphics, scale))
-		Return scale
-	End Function
-
+		SetStatus(GdipGetPageScale(nativeGraphics, PageScale))
+	End Function
+/*
 	Const Function PageUnit() As GraphicsUnit
-		Dim unit As GraphicsUnit
-		SetStatus(GdipGetPageUnit(nativeGraphics, unit))
-		Return unit
-	End Function
-
-	Function PageUnit(unit As GraphicsUnit) As Status
-		Return SetStatus(GdipSetPageUnit(nativeGraphics, unit))
-	End Function
-
-	Function PixelOffsetMode() As PixelOffsetMode
-		Return GetPixelOffsetMode()
-	End Function
-
-	Sub PixelOffsetMode(mode  As PixelOffsetMode)
-		SetPixelOffsetMode(mode)
+		SetStatus(GdipGetPageUnit(nativeGraphics, PageUnit))
+	End Function
+*/
+	Sub PageUnit(unit As GraphicsUnit)
+		SetStatus(GdipSetPageUnit(nativeGraphics, unit))
+	End Sub
+/*
+	Function PixelOffsetMode() As Drawing2D.PixelOffsetMode
+		PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Invalid
+		SetStatus(GdipGetPixelOffsetMode(nativeGraphics, PixelOffsetMode))
+	End Function
+*/
+	Sub PixelOffsetMode(mode As Drawing2D.PixelOffsetMode)
+		SetStatus(GdipSetPixelOffsetMode(nativeGraphics, mode))
 	End Sub
 
 	Function RenderingOrigin() As Point
-		Dim pt As Point
-		GetRenderingOrigin(pt.X, pt.Y)
-		Return pt
+		With RenderingOrigin
+			.X = 0
+			.Y = 0
+			SetStatus(GdipGetRenderingOrigin(nativeGraphics, .X, .Y))
+		End With
 	End Function
 
 	Sub RenderingOrigin(pt As Point)
-		SetRenderingOrigin(pt.X, pt.Y)
-	End Sub
-
-	Function SmoothingMode() As SmoothingMode
-		Return GetSmoothingMode()
-	End Function
-
-	Sub SmoothingMode(mode As SmoothingMode)
-		SetSmoothingMode(mode)
+		SetStatus(GdipSetRenderingOrigin(nativeGraphics, pt.X, pt.Y))
+	End Sub
+/*
+	Function SmoothingMode() As Drawing2D.SmoothingMode
+		SetStatus(GdipGetSmoothingMode(nativeGraphics, SmoothingMode))
+	End Function
+*/
+	Sub SmoothingMode(mode As Drawing2D.SmoothingMode)
+		SetStatus(GdipSetSmoothingMode(nativeGraphics, mode))
 	End Sub
 
 	Function TextContrast() As DWord
-		Return GetTextContrast()
+		SetStatus(GdipGetTextContrast(nativeGraphics, TextContrast))
 	End Function
 
 	Sub TextContrast(contrast As DWord)
-		SetTextContrast(contrast)
-	End Sub
-
-	Function TextRenderingHint() As TextRenderingHint
-		Return GetTextRenderingHint()
-	End Function
-
+		SetStatus(GdipSetTextContrast(nativeGraphics, contrast))
+	End Sub
+/*
+	Function TextRenderingHint() As Text.TextRenderingHint
+		SetStatus(GdipGetTextRenderingHint(nativeGraphics, ByVal VarPtr(TextRenderingHint)))
+	End Function
+*/
 	Sub TextRenderingHint(mode As TextRenderingHint)
-		SetTextRenderingHint(mode)
-	End Sub
-
-	Function Transform() As Matrix
-		Dim matrix As Matrix
-		GetTransform(matrix)
-		Return matrix
-	End Function
-
-	Sub Transform(matrix As Matrix)
-		SetTransform(matirx)
+		SetStatus(GdipSetTextRenderingHint(nativeGraphics, mode))
+	End Sub
+
+	Function Transform() As Drawing2D.Matrix
+		Dim native As *GpMatrix
+		SetStatus(GdipGetWorldTransform(nativeGraphics, native))
+		Transform = New Drawing2D.Matrix(native)
+	End Function
+
+	Sub Transform(matrix As Drawing2D.Matrix)
+		SetStatus(GdipSetWorldTransform(nativeGraphics, matrix.nativeMatrix))
 	End Sub
 
 	Function VisibleClipBounds() As RectangleF
-		Dim rc As RectangleF
-		GetVisibleClipBounds(rc)
-		Return rc
+		SetStatus(GdipGetVisibleClipBounds(nativeGraphics, VisibleClipBounds))
+	End Function
+
+	Function VisibleClipBoundsI() As Rectangle
+		SetStatus(GdipGetVisibleClipBoundsI(nativeGraphics, VisibleClipBoundsI))
 	End Function
 
@@ -169,81 +205,60 @@
 	'=========================================================================
 	Static Function FromHDC(hdc As HDC) As Graphics
-		Return New Graphics(hdc)
+		Dim graphics = 0 As *GpGraphics
+		SetStatus(GdipCreateFromHDC(hdc, graphics))
+		Return New Graphics(graphics)
 	End Function
 
 	Static Function FromHDC(hdc As HDC, hdevice As HANDLE) As Graphics
-		Return New Graphics(hdc, hdevice)
-	End Function
-
-	Static Function FromHWND(hwnd As HWND) As Graphics
-		Return New Graphics(hwnd, FALSE)
-	End Function
-
-	Static Function FromHWND(hwnd As DWord, icm As BOOL) As Graphics
-		Return New Graphics(hwnd, icm)
+		Dim graphics = 0 As *GpGraphics
+		SetStatus(GdipCreateFromHDC2(hdc, hdevice, graphics))
+		Return New Graphics(graphics)
+	End Function
+
+	Static Function FromHwnd(hwnd As HWND) As Graphics
+		Dim graphics = 0 As *GpGraphics
+		SetStatus(GdipCreateFromHWND(hwnd, graphics))
+		Return New Graphics(graphics)
+	End Function
+
+	Static Function FromHwnd(hwnd As HWND, icm As Boolean) As Graphics
+		Dim graphics = 0 As *GpGraphics
+		If icm Then
+			SetStatus(GdipCreateFromHWNDICM(hwnd, graphics))
+		Else
+			SetStatus(GdipCreateFromHWND(hwnd, graphics))
+		End If
+		Return New Graphics(graphics)
 	End Function
 
 	Static Function FromImage(image As Image) As Graphics
-		Return New Graphics(image)
-	End Function
-
-	Sub Graphics(hdc As HDC)
-		Dim graphics = 0 As GpGraphics
-		lastResult = GdipCreateFromHDC(hdc, graphics)
-		SetNativeGraphics(graphics)
-	End Sub
-
-	Sub Graphics(hdc As HDC, hdevice As HANDLE)
+		If ActiveBasic.IsNothing(image) Then
+			Throw New ArgumentNullException("image")
+		End If
 		Dim graphics = 0 As *GpGraphics
-		lastResult = GdipCreateFromHDC2(hdc, hdevice, graphics)
-		SetNativeGraphics(graphics)
-	End Sub
-
-	Sub Graphics(hwnd As HWND)
-		Dim graphics = 0 As *GpGraphics
-		lastResult = GdipCreateFromHWND(hwnd, graphics)
-		SetNativeGraphics(graphics)
-	End Sub
-
-	Sub Graphics(hwnd As HWND, icm As BOOL)
-		Dim graphics = 0 As *GpGraphics
-		If icm <> FALSE Then
-			lastResult = GdipCreateFromHWNDICM(hwnd, graphics)
-		Else
-			lastResult = GdipCreateFromHWND(hwnd, graphics)
-		End If
-		SetNativeGraphics(graphics)
-	End Sub
-
-	Sub Graphics(image As Image)
-		Dim graphics = 0 As *GpGraphics
-		If (image != 0)
-			lastResult = GdipGetImageGraphicsContext(image->NativeImage, graphics)
-		End If
-		SetNativeGraphics(graphics)
+		SetStatus(GdipGetImageGraphicsContext(image.nativeImage, graphics))
+		Return New Graphics(graphics)
+	End Function
+
+	Sub Dispose()
+		GdipDeleteGraphics(nativeGraphics)
+		nativeGraphics = 0
 	End Sub
 
 	Sub ~Graphics()
-		GdipDeleteGraphics(nativeGraphics)
+		Dispose()
 	End Sub
 
 	Sub Flush()
-		GdipFlush(nativeGraphics, FlushIntention.Flush)
-	End Sub
-
-	Sub Flush(intention As FlushIntention)
+		GdipFlush(nativeGraphics, System.Drawing.Drawing2D.FlushIntention.Flush)
+	End Sub
+
+	Sub Flush(intention As Drawing2D.FlushIntention)
 		GdipFlush(nativeGraphics, intention)
 	End Sub
 
-	'------------------------------------------------------------------------
-	' GDI Interop methods
-	'------------------------------------------------------------------------
-
-	' Locks the graphics until ReleaseDC is called
-
 	Function GetHDC() As HDC
-		Dim hdc = 0 As HDC
-		SetStatus(GdipGetDC(nativeGraphics, hdc))
-		Return hdc
+		GetHDC = 0
+		SetStatus(GdipGetDC(nativeGraphics, GetHDC))
 	End Function
 
@@ -252,855 +267,553 @@
 	End Sub
 
-	'------------------------------------------------------------------------
-	' Rendering modes
-	'------------------------------------------------------------------------
-
-	Function SetRenderingOrigin(x As Long, y As Long) As Status
-		Return SetStatus(GdipSetRenderingOrigin(nativeGraphics, x, y))
-	End Function
-
-	Const Function GetRenderingOrigin(x As Long, y As Long) As Status
-		Return SetStatus(GdipGetRenderingOrigin(nativeGraphics, x, y))
-	End Function
-
-	Function SetCompositingMode(compositingMode As CompositingMode) As Status
-		Return SetStatus(GdipSetCompositingMode(nativeGraphics, compositingMode))
-	End Function
-
-	Const Function GetCompositingMode() As CompositingMode
-		Dim mode As CompositingMode
-		SetStatus(GdipGetCompositingMode(nativeGraphics, mode))
-		Return mode
-	End Function
-
-	Function SetCompositingQuality(compositingQuality As CompositingQuality)
-		Return SetStatus(GdipSetCompositingQuality(nativeGraphics, compositingQuality))
-	End Function
-
-	Const Function GetCompositingQuality() As CompositingQuality
-		Dim quality As CompositingQuality
-		SetStatus(GdipGetCompositingQuality(nativeGraphics, quality))
-		Return quality
-	End Function
-
-	Function SetTextRenderingHint(newMode As TextRenderingHint) As Status
-		Return SetStatus(GdipSetTextRenderingHint(nativeGraphics, newMode))
-	End Function
-
-	Const Function GetTextRenderingHint() As TextRenderingHint
-		Dim hint As TextRenderingHint
-		SetStatus(GdipGetTextRenderingHint(nativeGraphics, hint))
-		Return hint
-	End Function
-
-	Function SetTextContrast(contrast As DWord) As Status
-		Return SetStatus(GdipSetTextContrast(nativeGraphics, contrast))
-	End Function
-
-	Const Function GetTextContrast() As DWord
-		Dim contrast As DWord
-		SetStatus(GdipGetTextContrast(nativeGraphics, contrast))
-		Return contrast
-	End Function
-
-	Const Function GetInterpolationMode() As InterpolationMode
-		Dim mode = InterpolationMode.Invalid As InterpolationMode
-		SetStatus(GdipGetInterpolationMode(nativeGraphics, mode))
-		Return mode
-	End Function
-
-	Function SetInterpolationMode(interpolationMode As InterpolationMode) As Status
-		Return SetStatus(GdipSetInterpolationMode(nativeGraphics, interpolationMode))
-	End Function
-
-	Const Function GetSmoothingMode() As SmoothingMode
-		Dim smoothingMode = SmoothingMode.Invalid As SmoothingMode
-		SetStatus(GdipGetSmoothingMode(nativeGraphics, smoothingMode))
-		Return smoothingMode
-	End Function
-
-	Function SetSmoothingMode(smoothingMode As SmoothingMode) As Status
-		Return SetStatus(GdipSetSmoothingMode(nativeGraphics, smoothingMode))
-	End Function
-
-	Const Function GetPixelOffsetMode() As PixelOffsetMode
-		Dim pixelOffsetMode = PixelOffsetMode.Invalid As PixelOffsetMode
-		SetStatus(GdipGetPixelOffsetMode(nativeGraphics, pixelOffsetMode))
-		Return pixelOffsetMode
-	End Function
-
-	Function SetPixelOffsetMode(pixelOffsetMode As PixelOffsetMode) As Status
-		Return SetStatus(GdipSetPixelOffsetMode(nativeGraphics, pixelOffsetMode))
-	End Function
-
-	'------------------------------------------------------------------------
-	' Manipulate current world transform
-	'------------------------------------------------------------------------
-
-	Function SetTransform(matrix As /*Const*/ *Matrix) As Status
-		Return SetStatus(GdipSetWorldTransform(nativeGraphics, matrix->nativeMatrix))
-	End Function
-
-	Function ResetTransform() As Status
-		Return SetStatus(GdipResetWorldTransform(nativeGraphics))
-	End Function
-
-	Function MultiplyTransform(matrix As /*Const*/ Matrix) As Status
-		Return SetStatus(GdipMultiplyWorldTransform(nativeGraphics, matrix->nativeMatrix, MatrixOrder.Prepend))
-	End Function
-
-	Function MultiplyTransform(matrix As /*Const*/ Matrix, order As MatrixOrder) As Status
-		Return SetStatus(GdipMultiplyWorldTransform(nativeGraphics, matrix->nativeMatrix, order))
-	End Function
-
-	Function TranslateTransform(dx As Single, dy As Single) As Status
-		Return SetStatus(GdipTranslateWorldTransform(nativeGraphics, dx, dy, MatrixOrder.Prepend))
-	End Function
-
-	Function TranslateTransform(dx As Single, dy As Single, order As MatrixOrder) As Status
-		Return SetStatus(GdipTranslateWorldTransform(nativeGraphics, dx, dy, order))
-	End Function
-
-	Function ScaleTransform(sx As Single, sy As Single) As Status
-		Return SetStatus(GdipScaleWorldTransform(nativeGraphics, sx, sy, MatrixOrder.Prepend))
-	End Function
-
-	Function ScaleTransform(sx As Single, sy As Single, order As MatrixOrder) As Status
-		Return SetStatus(GdipScaleWorldTransform(nativeGraphics, sx, sy, order))
-	End Function
-
-	Function RotateTransform(angle As Single) As Status
-		Return SetStatus(GdipRotateWorldTransform(nativeGraphics, angle, MatrixOrder.Prepend))
-	End Function
-
-	Function RotateTransform(angle As Single, order As MatrixOrder) As Status
-		Return SetStatus(GdipRotateWorldTransform(nativeGraphics, angle, order))
-	End Function
-
-	Const Function GetTransform(matrix As Matrix) As Status
-		Return SetStatus(GdipGetWorldTransform(nativeGraphics, matrix->nativeMatrix))
-	End Function
-
-	Const Function TransformPoints(destSpace As CoordinateSpace, srcSpace As CoordinateSpace, pts As PointF, count As Long) As Status
-		Return SetStatus(GdipTransformPoints(nativeGraphics, destSpace, srcSpace, pts, count))
-	End Function
-
-	Const Function TransformPoints(destSpace As CoordinateSpace, srcSpace As CoordinateSpace, pts As Point, count As Long) As Status
-		Return SetStatus(GdipTransformPointsI(nativeGraphics, destSpace, srcSpace, pts, count))
-	End Function
-
-	'------------------------------------------------------------------------
-	' GetNearestColor (for <= 8bpp surfaces).	Note: Alpha is ignored.
-	'------------------------------------------------------------------------
-
-	Const Function GetNearestColor(color As Color) As Status
-		Dim argb = color->Value
-		Dim status = SetStatus(GdipGetNearestColor(nativeGraphics, argb))
-		color->Value = argb
-		Return status
-	End Function
-
-	Function DrawLine(pen As /*Const*/ Pen, x1 As Single, y1 As Single, x2 As Single, y2 As Single) As Status
-		Return SetStatus(GdipDrawLine(nativeGraphics, pen->nativePen, x1, y1, x2, y2))
-	End Function
-
-	Function DrawLine(pen As /*Const*/ Pen, pt1 As /*Const*/ PointF, pt2 As /*Const*/ PointF) As Status
-		Return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y)
-	End Function
-
-	Function DrawLines(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Status
-		Return SetStatus(GdipDrawLines(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawLine(pen As /*Const*/ Pen, x1 As Long, y1 As Long, x2 As Long, y2 As Long) As Status
-		Return SetStatus(GdipDrawLineI(nativeGraphics, pen->nativePen, x1, y1, x2, y2))
-	End Function
-
-	Function DrawLine(pen As /*Const*/ Pen, pt1 As /*Const*/ Point, pt2 As /*Const*/ Point) As Status
-		Return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y)
-	End Function
-
-	Function DrawLines(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Status
-		Return SetStatus(GdipDrawLinesI(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawArc(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single) As Status
-		Return SetStatus(GdipDrawArc(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
-	End Function
-
-	Function DrawArc(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Status
-		Return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
-	End Function
-
-	Function DrawArc(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single) As Status
-		Return SetStatus(GdipDrawArcI(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
-	End Function
-
-	Function DrawArc(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Status
-		Return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
-	End Function
-
-	Function DrawBezier(pen As /*Const*/ Pen, x1 As Single, y1 As Single, x2 As Single, y2 As Single, x3 As Single, y3 As Single, x4 As Single, y4 As Single) As Status
-		Return SetStatus(GdipDrawBezier(nativeGraphics, pen->nativePen, x1, y1,x2, y2, x3, y3, x4, y4))
-	End Function
-
-	Function DrawBezier(pen As /*Const*/ Pen, pt1 As /*Const*/ PointF, pt2 As /*Const*/ PointF, pt3 As /*Const*/ PointF, pt4 As /*Const*/ PointF) As Status
-		Return DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)
-	End Function
-
-	Function DrawBeziers(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Status
-		Return SetStatus(GdipDrawBeziers(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawBezier(pen As /*Const*/ Pen, x1 As Long, y1 As Long, x2 As Long, y2 As Long, x3 As Long, y3 As Long, x4 As Long, y4 As Long) As Status
-		Return SetStatus(GdipDrawBezierI(nativeGraphics, pen->nativePen, x1, y1, x2, y2, x3, y3, x4, y4))
-	End Function
-
-	Function DrawBezier(pen As /*Const*/ Pen, pt1 As /*Const*/ Point, pt2 As /*Const*/ Point, pt3 As /*Const*/ Point, pt4 As /*Const*/ Point) As Status
-		Return DrawBezier(pen pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)
-	End Function
-
-	Function DrawBeziers(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Status
-		Return SetStatus(GdipDrawBeziersI(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawRectangle(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF) As Status
-		Return DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function DrawRectangle(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single) As Status
-		Return SetStatus(GdipDrawRectangle(nativeGraphics, pen->nativePen, x, y, width, height))
-	End Function
-
-	Function DrawRectangles(pen As /*Const*/ Pen, rects As /*Const*/ *RectangleF, count As Long) As Status
-		Return SetStatus(GdipDrawRectangles(nativeGraphics, pen->nativePen, rects, count))
-	End Function
-
-	Function DrawRectangle(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle) As Status
-		Return DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function DrawRectangle(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long) As Status
-		Return SetStatus(GdipDrawRectangleI(nativeGraphics, pen->nativePen, x, y, width, height))
-	End Function
-
-	Function DrawRectangles(pen As /*Const*/ Pen, rects As /*Const*/ *Rectangle,  count As Long) As Status
-		Return SetStatus(GdipDrawRectanglesI(nativeGraphics, pen->nativePen, rects, count))
-	End Function
-
-	Function DrawEllipse(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF) As Status
-		Return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function DrawEllipse(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single) As Status
-		Return SetStatus(GdipDrawEllipse(nativeGraphics, pen->nativePen, x, y, width, height))
-	End Function
-
-	Function DrawEllipse(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle) As Status
-		Return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function DrawEllipse(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long) As Status
-		Return SetStatus(GdipDrawEllipseI(nativeGraphics, pen->nativePen, x, y, width, height))
-	End Function
-
-	Function DrawPie(pen As /*Const*/ Pen, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Status
-		Return DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
-	End Function
-
-	Function DrawPie(pen As /*Const*/ Pen, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single) As Status
-		Return SetStatus(GdipDrawPie(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
-	End Function
-
-	Function DrawPie(pen As /*Const*/ Pen, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Status
-		Return DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
-	End Function
-
-	Function DrawPie(pen As /*Const*/ Pen, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single) As Status
-		Return SetStatus(GdipDrawPieI(nativeGraphics, pen->nativePen, x, y, width, height, startAngle, sweepAngle))
-	End Function
-
-	Function DrawPolygon(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Status
-		Return SetStatus(GdipDrawPolygon(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawPolygon(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Status
-		Return SetStatus(GdipDrawPolygonI(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawPath(pen As /*Const*/ Pen, path As /*Const*/ GraphicsPath) As Status
-		Return SetStatus(GdipDrawPath(nativeGraphics, pen->nativePen, path->nativePath))
-'		Return SetStatus(GdipDrawPath(nativeGraphics, pen ? pen->nativePen : NULL, path ? path->nativePath : NULL))
-	End Function
-
-	Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Status
-		Return SetStatus(GdipDrawCurve(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, tension As Single) As Status
-		Return SetStatus(GdipDrawCurve2(nativeGraphics, pen->nativePen, points,count, tension))
-	End Function
-
-	Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, offset As Long, numberOfSegments As Long) As Status
-		Return SetStatus(GdipDrawCurve3(nativeGraphics, pen->nativePen, points, count, offset,numberOfSegments, 0.5))
-	End Function
-
-	Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, offset As Long, numberOfSegments As Long, tension As Single) As Status
-		Return SetStatus(GdipDrawCurve3(nativeGraphics, pen->nativePen, points, count, offset,numberOfSegments, tension))
-	End Function
-
-	Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Status
-		Return SetStatus(GdipDrawCurveI(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, tension As Single) As Status
-		Return SetStatus(GdipDrawCurve2I(nativeGraphics, pen->nativePen, points, count, tension))
-	End Function
-
-	Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, offset As Long, numberOfSegments As Long) As Status
-		Return SetStatus(GdipDrawCurve3I(nativeGraphics, pen->nativePen, points, count, offset, numberOfSegments, 0.5))
-	End Function
-
-	Function DrawCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, offset As Long, numberOfSegments As Long, tension As Single) As Status
-		Return SetStatus(GdipDrawCurve3I(nativeGraphics, pen->nativePen, points, count, offset, numberOfSegments, tension))
-	End Function
-
-	Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long) As Status
-		Return SetStatus(GdipDrawClosedCurve(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *PointF, count As Long, tension As Single) As Status
-		Return SetStatus(GdipDrawClosedCurve2(nativeGraphics, pen->nativePen, points, count, tension))
-	End Function
-
-	Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long) As Status
-		Return SetStatus(GdipDrawClosedCurveI(nativeGraphics, pen->nativePen, points, count))
-	End Function
-
-	Function DrawClosedCurve(pen As /*Const*/ Pen, points As /*Const*/ *Point, count As Long, tension As Single) As Status
-		Return SetStatus(GdipDrawClosedCurve2I(nativeGraphics, pen->nativePen, points, count, tension))
-	End Function
-
-	Function Clear(color As /*Const*/ Color) As Status
-		Return SetStatus(GdipGraphicsClear(nativeGraphics, color.Value))
-	End Function
-
-	Function FillRectangle(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF) As Status
-		Return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function FillRectangle(brush As /*Const*/ Brush, x As Single, y As Single, width As Single, height As Single) As Status
-		Return SetStatus(GdipFillRectangle(nativeGraphics, brush->nativeBrush, x, y, width, height))
-	End Function
-
-	Function FillRectangles(brush As /*Const*/ Brush, rects As /*Const*/ *RectangleF, count As Long) As Status
-		Return SetStatus(GdipFillRectangles(nativeGraphics,brush->nativeBrush,rects, count))
-	End Function
-
-	Function FillRectangle(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle) As Status
-		Return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function FillRectangle(brush As /*Const*/ Brush, x As Long, y As Long, width As Long, height As Long) As Status
-		Return SetStatus(GdipFillRectangleI(nativeGraphics, brush->nativeBrush, x, y, width, height))
-	End Function
-
-	Function FillRectangles(brush As /*Const*/ Brush, rects As /*Const*/ *Rectangle, count As Long) As Status
-		Return SetStatus(GdipFillRectanglesI(nativeGraphics, brush->nativeBrush, rects, count))
-	End Function
-
-	Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long) As Status
-		Return FillPolygon(brush, points, count, FillModeAlternate)
-	End Function
-
-	Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode) As Status
-		Return SetStatus(GdipFillPolygon(nativeGraphics, brush->nativeBrush, points, count, fillMode))
-	End Function
-
-	Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long) As Status
-		Return FillPolygon(brush, points, count, FillModeAlternate)
-	End Function
-
-	Function FillPolygon(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode) As Status
-		Return SetStatus(GdipFillPolygonI(nativeGraphics, brush->nativeBrush, points, count, fillMode))
-	End Function
-
-	Function FillEllipse(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF) As Status
-		Return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function FillEllipse(brush As /*Const*/ Brush, x As Single, y As Single, width As Single, height As Single) As Status
-		Return SetStatus(GdipFillEllipse(nativeGraphics, brush->nativeBrush, x, y, width, height))
-	End Function
-
-	Function FillEllipse(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle) As Status
-		Return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function FillEllipse(brush As /*Const*/ Brush, x As Long, y As Long, width As Long, height As Long) As Status
-		Return SetStatus(GdipFillEllipseI(nativeGraphics, brush->nativeBrush, x, y, width, height))
-	End Function
-
-	Function FillPie(brush As /*Const*/ Brush, rect As /*Const*/ RectangleF, startAngle As Single, sweepAngle As Single) As Status
-		Return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
-	End Function
-
-	Function FillPie(brush As /*Const*/ Brush, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single) As Status
-		Return SetStatus(GdipFillPie(nativeGraphics, brush->nativeBrush, x, y, width, height, startAngle, sweepAngle))
-	End Function
-
-	Function FillPie(brush As /*Const*/ Brush, rect As /*Const*/ Rectangle, startAngle As Single, sweepAngle As Single) As Status
-		Return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
-	End Function
-
-	Function FillPie(brush As /*Const*/ Brush, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single) As Status
-		Return SetStatus(GdipFillPieI(nativeGraphics, brush->nativeBrush, x, y, width, height, startAngle, sweepAngle))
-	End Function
-
-	Function FillPath(brush As /*Const*/ Brush, path As /*Const*/ GraphicsPath) As Status
-		Return SetStatus(GdipFillPath(nativeGraphics, brush->nativeBrush, path->nativePath))
-	End Function
-
-	Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long) As Status
-		Return SetStatus(GdipFillClosedCurve(nativeGraphics, brush->nativeBrush, points, count))
-	End Function
-
-	Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode) As Status
-		Return SetStatus(GdipFillClosedCurve2(nativeGraphics, brush->nativeBrush, points, count, 0.5, fillMode))
-	End Function
-
-	Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *PointF, count As Long, fillMode As FillMode, tension As Single) As Status
-		Return SetStatus(GdipFillClosedCurve2(nativeGraphics, brush->nativeBrush, points, count, tension, fillMode))
-	End Function
-
-	Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long) As Status
-		Return SetStatus(GdipFillClosedCurveI(nativeGraphics, brush->nativeBrush, points, count))
-	End Function
-
-	Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode) As Status
-		Return SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush->nativeBrush, points, count, 0.5, fillMode))
-	End Function
-
-	Function FillClosedCurve(brush As /*Const*/ Brush, points As /*Const*/ *Point, count As Long, fillMode As FillMode, tension As Single) As Status
-		Return SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush->nativeBrush, points, count, tension, fillMode))
-	End Function
-
-	Function FillRegion(brush As /*Const*/ Brush, region As /*Const*/ Region) As Status
-		Return SetStatus(GdipFillRegion(nativeGraphics, brush->nativeBrush, region->nativeRegion))
-	End Function
-
-	Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF) As Status
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
+	Sub ResetTransform()
+		SetStatus(GdipResetWorldTransform(nativeGraphics))
+	End Sub
+
+	Sub MultiplyTransform(matrix As Drawing2D.Matrix)
+		SetStatus(GdipMultiplyWorldTransform(nativeGraphics, matrix.nativeMatrix, System.Drawing.Drawing2D.MatrixOrder.Prepend))
+	End Sub
+
+	Sub MultiplyTransform(matrix As Drawing2D.Matrix, order As Drawing2D.MatrixOrder)
+		SetStatus(GdipMultiplyWorldTransform(nativeGraphics, matrix.nativeMatrix, order))
+	End Sub
+
+	Sub TranslateTransform(dx As Single, dy As Single)
+		SetStatus(GdipTranslateWorldTransform(nativeGraphics, dx, dy, System.Drawing.Drawing2D.MatrixOrder.Prepend))
+	End Sub
+
+	Sub TranslateTransform(dx As Single, dy As Single, order As Drawing2D.MatrixOrder)
+		SetStatus(GdipTranslateWorldTransform(nativeGraphics, dx, dy, order))
+	End Sub
+
+	Sub ScaleTransform(sx As Single, sy As Single)
+		SetStatus(GdipScaleWorldTransform(nativeGraphics, sx, sy, System.Drawing.Drawing2D.MatrixOrder.Prepend))
+	End Sub
+
+	Sub ScaleTransform(sx As Single, sy As Single, order As Drawing2D.MatrixOrder)
+		SetStatus(GdipScaleWorldTransform(nativeGraphics, sx, sy, order))
+	End Sub
+
+	Sub RotateTransform(angle As Single)
+		SetStatus(GdipRotateWorldTransform(nativeGraphics, angle, System.Drawing.Drawing2D.MatrixOrder.Prepend))
+	End Sub
+
+	Sub RotateTransform(angle As Single, order As Drawing2D.MatrixOrder)
+		SetStatus(GdipRotateWorldTransform(nativeGraphics, angle, order))
+	End Sub
+
+	Sub TransformPoints(destSpace As Drawing2D.CoordinateSpace, srcSpace As Drawing2D.CoordinateSpace, pts As *PointF, count As Long)
+		SetStatus(GdipTransformPoints(nativeGraphics, destSpace, srcSpace, pts, count))
+	End Sub
+
+	Sub TransformPoints(destSpace As Drawing2D.CoordinateSpace, srcSpace As Drawing2D.CoordinateSpace, pts As *Point, count As Long)
+		SetStatus(GdipTransformPointsI(nativeGraphics, destSpace, srcSpace, pts, count))
+	End Sub
+
+	Const Function GetNearestColor(color As Color) As Color
+		GetNearestColor = color
+		SetStatus(GdipGetNearestColor(nativeGraphics, GetNearestColor))
+	End Function
+
+	Sub DrawLine(pen As Pen, x1 As Single, y1 As Single, x2 As Single, y2 As Single)
+		SetStatus(GdipDrawLine(nativeGraphics, pen.NativePen, x1, y1, x2, y2))
+	End Sub
+
+	Sub DrawLine(pen As Pen, ByRef pt1 As PointF, ByRef pt2 As PointF)
+		DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y)
+	End Sub
+
+	Sub DrawLines(pen As Pen, points As *PointF, count As Long)
+		SetStatus(GdipDrawLines(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawLine(pen As Pen, x1 As Long, y1 As Long, x2 As Long, y2 As Long)
+		SetStatus(GdipDrawLineI(nativeGraphics, pen.NativePen, x1, y1, x2, y2))
+	End Sub
+
+	Sub DrawLine(pen As Pen, ByRef pt1 As Point, ByRef pt2 As Point)
+		DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y)
+	End Sub
+
+	Sub DrawLines(pen As Pen, points As *Point, count As Long)
+		SetStatus(GdipDrawLinesI(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawArc(pen As Pen, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single)
+		SetStatus(GdipDrawArc(nativeGraphics, pen.NativePen, x, y, width, height, startAngle, sweepAngle))
+	End Sub
+
+	Sub DrawArc(pen As Pen, ByRef rect As RectangleF, startAngle As Single, sweepAngle As Single)
+		DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
+	End Sub
+
+	Sub DrawArc(pen As Pen, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single)
+		SetStatus(GdipDrawArcI(nativeGraphics, pen.NativePen, x, y, width, height, startAngle, sweepAngle))
+	End Sub
+
+	Sub DrawArc(pen As Pen, ByRef rect As Rectangle, startAngle As Single, sweepAngle As Single)
+		DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
+	End Sub
+
+	Sub DrawBezier(pen As Pen, x1 As Single, y1 As Single, x2 As Single, y2 As Single, x3 As Single, y3 As Single, x4 As Single, y4 As Single)
+		SetStatus(GdipDrawBezier(nativeGraphics, pen.NativePen, x1, y1,x2, y2, x3, y3, x4, y4))
+	End Sub
+
+	Sub DrawBezier(pen As Pen, ByRef pt1 As PointF, ByRef pt2 As PointF, ByRef pt3 As PointF, ByRef pt4 As PointF)
+		DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)
+	End Sub
+
+	Sub DrawBeziers(pen As Pen, points As *PointF, count As Long)
+		SetStatus(GdipDrawBeziers(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawBezier(pen As Pen, x1 As Long, y1 As Long, x2 As Long, y2 As Long, x3 As Long, y3 As Long, x4 As Long, y4 As Long)
+		SetStatus(GdipDrawBezierI(nativeGraphics, pen.NativePen, x1, y1, x2, y2, x3, y3, x4, y4))
+	End Sub
+
+	Sub DrawBezier(pen As Pen, ByRef pt1 As Point, ByRef pt2 As Point, ByRef pt3 As Point, ByRef pt4 As Point)
+		DrawBezier(pen, pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X, pt4.Y)
+	End Sub
+
+	Sub DrawBeziers(pen As Pen, points As *Point, count As Long)
+		SetStatus(GdipDrawBeziersI(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawRectangle(pen As Pen, ByRef rect As RectangleF)
+		DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub DrawRectangle(pen As Pen, x As Single, y As Single, width As Single, height As Single)
+		SetStatus(GdipDrawRectangle(nativeGraphics, pen.NativePen, x, y, width, height))
+	End Sub
+
+	Sub DrawRectangles(pen As Pen, rects As *RectangleF, count As Long)
+		SetStatus(GdipDrawRectangles(nativeGraphics, pen.NativePen, rects, count))
+	End Sub
+
+	Sub DrawRectangle(pen As Pen, ByRef rect As Rectangle)
+		DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub DrawRectangle(pen As Pen, x As Long, y As Long, width As Long, height As Long)
+		SetStatus(GdipDrawRectangleI(nativeGraphics, pen.NativePen, x, y, width, height))
+	End Sub
+
+	Sub DrawRectangles(pen As Pen, rects As *Rectangle, count As Long)
+		SetStatus(GdipDrawRectanglesI(nativeGraphics, pen.NativePen, rects, count))
+	End Sub
+
+	Sub DrawEllipse(pen As Pen, ByRef rect As RectangleF)
+		DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub DrawEllipse(pen As Pen, x As Single, y As Single, width As Single, height As Single)
+		SetStatus(GdipDrawEllipse(nativeGraphics, pen.NativePen, x, y, width, height))
+	End Sub
+
+	Sub DrawEllipse(pen As Pen, ByRef rect As Rectangle)
+		DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub DrawEllipse(pen As Pen, x As Long, y As Long, width As Long, height As Long)
+		SetStatus(GdipDrawEllipseI(nativeGraphics, pen.NativePen, x, y, width, height))
+	End Sub
+
+	Sub DrawPie(pen As Pen, ByRef rect As RectangleF, startAngle As Single, sweepAngle As Single)
+		DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
+	End Sub
+
+	Sub DrawPie(pen As Pen, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single)
+		SetStatus(GdipDrawPie(nativeGraphics, pen.NativePen, x, y, width, height, startAngle, sweepAngle))
+	End Sub
+
+	Sub DrawPie(pen As Pen, ByRef rect As Rectangle, startAngle As Single, sweepAngle As Single)
+		DrawPie(pen, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
+	End Sub
+
+	Sub DrawPie(pen As Pen, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single)
+		SetStatus(GdipDrawPieI(nativeGraphics, pen.NativePen, x, y, width, height, startAngle, sweepAngle))
+	End Sub
+
+	Sub DrawPolygon(pen As Pen, points As *PointF, count As Long)
+		SetStatus(GdipDrawPolygon(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawPolygon(pen As Pen, points As *Point, count As Long)
+		SetStatus(GdipDrawPolygonI(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawPath(pen As Pen, path As GraphicsPath)
+		If ActiveBasic.IsNothing(pen) Or ActiveBasic.IsNothing(path) Then
+			Throw New ArgumentNullException("pen or path or both")
 		End If
-		Return SetStatus(GdipDrawString( nativeGraphics, str, length, nativeFont, layoutRect, 0, 0))
-	End Function
-
-	Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ Rectangle,
-		stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Status
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
+		SetStatus(GdipDrawPath(nativeGraphics, pen.NativePen, path.nativePath))
+	End Sub
+
+	Sub DrawCurve(pen As Pen, points As *PointF, count As Long)
+		SetStatus(GdipDrawCurve(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawCurve(pen As Pen, points As *PointF, count As Long, tension As Single)
+		SetStatus(GdipDrawCurve2(nativeGraphics, pen.NativePen, points,count, tension))
+	End Sub
+
+	Sub DrawCurve(pen As Pen, points As *PointF, count As Long, offset As Long, numberOfSegments As Long)
+		SetStatus(GdipDrawCurve3(nativeGraphics, pen.NativePen, points, count, offset,numberOfSegments, 0.5))
+	End Sub
+
+	Sub DrawCurve(pen As Pen, points As *PointF, count As Long, offset As Long, numberOfSegments As Long, tension As Single)
+		SetStatus(GdipDrawCurve3(nativeGraphics, pen.NativePen, points, count, offset,numberOfSegments, tension))
+	End Sub
+
+	Sub DrawCurve(pen As Pen, points As *Point, count As Long)
+		SetStatus(GdipDrawCurveI(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawCurve(pen As Pen, points As *Point, count As Long, tension As Single)
+		SetStatus(GdipDrawCurve2I(nativeGraphics, pen.NativePen, points, count, tension))
+	End Sub
+
+	Sub DrawCurve(pen As Pen, points As *Point, count As Long, offset As Long, numberOfSegments As Long)
+		SetStatus(GdipDrawCurve3I(nativeGraphics, pen.NativePen, points, count, offset, numberOfSegments, 0.5))
+	End Sub
+
+	Sub DrawCurve(pen As Pen, points As *Point, count As Long, offset As Long, numberOfSegments As Long, tension As Single)
+		SetStatus(GdipDrawCurve3I(nativeGraphics, pen.NativePen, points, count, offset, numberOfSegments, tension))
+	End Sub
+
+	Sub DrawClosedCurve(pen As Pen, points As *PointF, count As Long)
+		SetStatus(GdipDrawClosedCurve(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawClosedCurve(pen As Pen, points As *PointF, count As Long, tension As Single)
+		SetStatus(GdipDrawClosedCurve2(nativeGraphics, pen.NativePen, points, count, tension))
+	End Sub
+
+	Sub DrawClosedCurve(pen As Pen, points As *Point, count As Long)
+		SetStatus(GdipDrawClosedCurveI(nativeGraphics, pen.NativePen, points, count))
+	End Sub
+
+	Sub DrawClosedCurve(pen As Pen, points As *Point, count As Long, tension As Single)
+		SetStatus(GdipDrawClosedCurve2I(nativeGraphics, pen.NativePen, points, count, tension))
+	End Sub
+
+	Sub Clear(color As Color)
+		SetStatus(GdipGraphicsClear(nativeGraphics, color))
+	End Sub
+
+	Sub FillRectangle(brush As Brush, ByRef rect As RectangleF)
+		FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub FillRectangle(brush As Brush, x As Single, y As Single, width As Single, height As Single)
+		SetStatus(GdipFillRectangle(nativeGraphics, brush.nativeBrush, x, y, width, height))
+	End Sub
+
+	Sub FillRectangles(brush As Brush, rects As *RectangleF, count As Long)
+		SetStatus(GdipFillRectangles(nativeGraphics,brush.nativeBrush,rects, count))
+	End Sub
+
+	Sub FillRectangle(brush As Brush, ByRef rect As Rectangle)
+		FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub FillRectangle(brush As Brush, x As Long, y As Long, width As Long, height As Long)
+		SetStatus(GdipFillRectangleI(nativeGraphics, brush.nativeBrush, x, y, width, height))
+	End Sub
+
+	Sub FillRectangles(brush As Brush, rects As *Rectangle, count As Long)
+		SetStatus(GdipFillRectanglesI(nativeGraphics, brush.nativeBrush, rects, count))
+	End Sub
+
+'	Sub FillPolygon(brush As Brush, points As *PointF, count As Long)
+'		FillPolygon(brush, points, count, System.Drawing.Drawing2D.FillMode.Alternate)
+'	End Sub
+
+	Sub FillPolygon(brush As Brush, points As *PointF, count As Long, fillMode As Drawing2D.FillMode)
+		SetStatus(GdipFillPolygon(nativeGraphics, brush.nativeBrush, points, count, fillMode))
+	End Sub
+
+'	Sub FillPolygon(brush As Brush, points As *Point, count As Long)
+'		FillPolygon(brush, points, count, System.Drawing.Drawing2D.FillMode.Alternate)
+'	End Sub
+
+	Sub FillPolygon(brush As Brush, points As *Point, count As Long, fillMode As Drawing2D.FillMode)
+		SetStatus(GdipFillPolygonI(nativeGraphics, brush.nativeBrush, points, count, fillMode))
+	End Sub
+
+	Sub FillEllipse(brush As Brush, ByRef rect As RectangleF)
+		FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub FillEllipse(brush As Brush, x As Single, y As Single, width As Single, height As Single)
+		SetStatus(GdipFillEllipse(nativeGraphics, brush.nativeBrush, x, y, width, height))
+	End Sub
+
+	Sub FillEllipse(brush As Brush, ByRef rect As Rectangle)
+		FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub FillEllipse(brush As Brush, x As Long, y As Long, width As Long, height As Long)
+		SetStatus(GdipFillEllipseI(nativeGraphics, brush.nativeBrush, x, y, width, height))
+	End Sub
+
+	Sub FillPie(brush As Brush, ByRef rect As RectangleF, startAngle As Single, sweepAngle As Single)
+		FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
+	End Sub
+
+	Sub FillPie(brush As Brush, x As Single, y As Single, width As Single, height As Single, startAngle As Single, sweepAngle As Single)
+		SetStatus(GdipFillPie(nativeGraphics, brush.nativeBrush, x, y, width, height, startAngle, sweepAngle))
+	End Sub
+
+	Sub FillPie(brush As Brush, ByRef rect As Rectangle, startAngle As Single, sweepAngle As Single)
+		FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height, startAngle, sweepAngle)
+	End Sub
+
+	Sub FillPie(brush As Brush, x As Long, y As Long, width As Long, height As Long, startAngle As Single, sweepAngle As Single)
+		SetStatus(GdipFillPieI(nativeGraphics, brush.nativeBrush, x, y, width, height, startAngle, sweepAngle))
+	End Sub
+
+	Sub FillPath(brush As Brush, path As GraphicsPath)
+		If ActiveBasic.IsNothing(brush) Or ActiveBasic.IsNothing(path) Then
+			Throw New ArgumentNullException("brush or path or both")
 		End If
-		Dim nativeFormat As *GpStringFormat
-		If VarPtr(layoutRect) <> 0 Then
-			nativeFormat = layoutRect.nativeFormat
-		Else
-			nativeFormat = 0
+		SetStatus(GdipFillPath(nativeGraphics, brush.nativeBrush, path.nativePath))
+	End Sub
+
+	Sub FillClosedCurve(brush As Brush, points As *PointF, count As Long)
+		SetStatus(GdipFillClosedCurve(nativeGraphics, brush.nativeBrush, points, count))
+	End Sub
+
+	Sub FillClosedCurve(brush As Brush, points As *PointF, count As Long, fillMode As Drawing2D.FillMode)
+		SetStatus(GdipFillClosedCurve2(nativeGraphics, brush.nativeBrush, points, count, 0.5, fillMode))
+	End Sub
+
+	Sub FillClosedCurve(brush As Brush, points As *PointF, count As Long, fillMode As Drawing2D.FillMode, tension As Single)
+		SetStatus(GdipFillClosedCurve2(nativeGraphics, brush.nativeBrush, points, count, tension, fillMode))
+	End Sub
+
+	Sub FillClosedCurve(brush As Brush, points As *Point, count As Long)
+		SetStatus(GdipFillClosedCurveI(nativeGraphics, brush.nativeBrush, points, count))
+	End Sub
+
+	Sub FillClosedCurve(brush As Brush, points As *Point, count As Long, fillMode As Drawing2D.FillMode)
+		SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush.nativeBrush, points, count, 0.5, fillMode))
+	End Sub
+
+	Sub FillClosedCurve(brush As Brush, points As *Point, count As Long, fillMode As Drawing2D.FillMode, tension As Single)
+		SetStatus(GdipFillClosedCurve2I(nativeGraphics, brush.nativeBrush, points, count, tension, fillMode))
+	End Sub
+
+	Sub FillRegion(brush As Brush, region As Region)
+		SetStatus(GdipFillRegion(nativeGraphics, brush.nativeBrush, region.nativeRegion))
+	End Sub
+
+'DrawStringは次の組み合わせからなる。
+'(PCWSTR, Long) or String
+'PointF or (Single, Single) or Rectangle
+'StringFormatの有無
+	Sub DrawString(str As PCWSTR, length As Long, font As Font, brush As Brush, ByRef origin As PointF, stringFormat = Nothing As StringFormat)
+		DrawString(str, length, font, brush, origin.X, origin.Y, stringFormat)
+	End Sub
+
+	Sub DrawString(str As PCWSTR, length As Long, font As Font, brush As Brush, x As Single, y As Single, stringFormat = Nothing As StringFormat)
+		Dim rc As RectangleF
+		rc.X = x
+		rc.Y = y
+		rc.Width = 0
+		rc.Height = 0
+		DrawString(str, length, font, brush, rc, stringFormat)
+	End Sub
+
+	Sub DrawString(str As PCWSTR, length As Long, font As Font, brush As Brush, ByRef layoutRect As RectangleF, stringFormat = Nothing As StringFormat)
+		Dim nativeFont = getNativeFont(font)
+		Dim nativeFormat = getNativeStringFormat(stringFormat)
+		Dim nativeBrush = getNativeBrush(brush)
+		SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, nativeBrush))
+	End Sub
+
+	Sub DrawString(s As String, font As Font, brush As Brush, ByRef origin As PointF, stringFormat = Nothing As StringFormat)
+		DrawString(s, font, brush, origin.X, origin.Y, stringFormat)
+	End Sub
+
+	Sub DrawString(s As String, font As Font, brush As Brush, x As Single, y As Single, stringFormat = Nothing As StringFormat)
+		Dim rc As RectangleF
+		rc.X = x
+		rc.Y = y
+		rc.Width = 0
+		rc.Height = 0
+		DrawString(s, font, brush, rc, stringFormat)
+	End Sub
+
+	Sub DrawString(s As String, font As Font, brush As Brush, ByRef layoutRect As RectangleF, stringFormat = Nothing As StringFormat)
+		Dim wcs As PCWSTR
+		Dim len = GetStr(s, wcs) As Long
+		DrawString(wcs, len As Long, font, brush, layoutRect, stringFormat)
+	End Sub
+
+	Function MeasureString(s As String, font As Font) As SizeF
+		Dim pt As PointF
+		MeasureString = MeasureString(s, font, pt, Nothing)
+	End Function
+
+	Function MeasureString(s As String, font As Font, ByRef layoutRectSize As SizeF) As SizeF
+		MeasureString = MeasureString(s, font, layoutRectSize, Nothing)
+	End Function
+
+	Function MeasureString(s As String, font As Font, ByRef layoutRectSize As SizeF, stringFormat As StringFormat) As SizeF
+		Dim wcs As PCWSTR
+		Dim len = GetStr(s, wcs) As Long
+		MeasureString = MeasureString(wcs, len, font, layoutRectSize, stringFormat)
+	End Function
+
+	Function MeasureString(s As String, font As Font, ByRef origin As PointF, stringFormat As StringFormat) As SizeF
+		Dim wcs As PCWSTR
+		Dim len = GetStr(s, wcs) As Long
+		MeasureString = MeasureString(wcs, len, font, origin, stringFormat)
+	End Function
+
+	Function MeasureString(s As String, font As Font, width As Long, stringFormat As StringFormat) As SizeF
+		Dim wcs As PCWSTR
+		Dim len = GetStr(s, wcs) As Long
+		MeasureString = MeasureString(wcs, len, font, width, stringFormat)
+	End Function
+
+	Function MeasureString(s As String, font As Font, ByRef layoutRectSize As SizeF, stringFormat As StringFormat, ByRef codepointsFitted As Long, ByRef linesFilled As Long) As SizeF
+		Dim wcs As PCWSTR
+		Dim len = GetStr(s, wcs) As Long
+		MeasureString = MeasureString(wcs, len, font, layoutRectSize, stringFormat, codepointsFitted, linesFilled)
+	End Function
+
+	Function MeasureString(str As PCWSTR, length As Long, font As Font) As SizeF
+		Dim pt As PointF
+		MeasureString = MeasureString(str, length, font, pt, Nothing)
+	End Function
+
+	Function MeasureString(str As PCWSTR, length As Long, font As Font, ByRef layoutRectSize As SizeF) As SizeF
+		MeasureString = MeasureString(str, length, font, layoutRectSize, Nothing)
+	End Function
+
+	Function MeasureString(str As PCWSTR, length As Long, font As Font, ByRef layoutRectSize As SizeF, stringFormat As StringFormat) As SizeF
+		MeasureString = measureStringPt(str, length, font, layoutRectSize, stringFormat, 0, 0)
+	End Function
+
+	Function MeasureString(str As PCWSTR, length As Long, font As Font, ByRef origin As PointF, stringFormat As StringFormat) As SizeF
+		Dim layoutRect As RectangleF
+		With layoutRect
+			.X = origin.X
+			.Y = origin.Y
+			.Width = 0
+			.Height = 0
+		End With
+		MeasureString = measureString(str, length, font, layoutRect, stringFormat, 0, 0)
+	End Function
+
+	Function MeasureString(str As PCWSTR, length As Long, font As Font, width As Long, stringFormat As StringFormat) As SizeF
+		Dim layoutRect As RectangleF
+		With layoutRect
+			.X = 0
+			.Y = 0
+			.Width = width
+			.Height = 0
+		End With
+		MeasureString = measureString(str, length, font, layoutRect, stringFormat, 0, 0)
+	End Function
+
+	Function MeasureString(str As PCWSTR, length As Long, font As Font, ByRef layoutRectSize As SizeF, stringFormat As StringFormat, ByRef codepointsFitted As Long, ByRef linesFilled As Long) As SizeF
+		MeasureString = measureStringPt(str, length, font, layoutRectSize, stringFormat, VarPtr(codepointsFitted), VarPtr(linesFilled))
+	End Function
+
+Private
+	Function measureStringPt(str As PCWSTR, length As Long, font As Font, ByRef layoutRectSize As SizeF, stringFormat As StringFormat, codepointsFitted As *Long, linesFilled As *Long) As SizeF
+		Dim layoutRect As RectangleF
+		With layoutRect
+			.X = 0
+			.Y = 0
+			.Width = layoutRectSize.Width
+			.Height = layoutRectSize.Height
+		End With
+		measureStringPt = measureString(str, length, font, layoutRect, stringFormat, codepointsFitted, linesFilled)
+	End Function
+
+	Function measureString(str As PCWSTR, length As Long, font As Font, ByRef layoutRect As RectangleF, stringFormat As StringFormat, codepointsFitted As *Long, linesFilled As *Long) As SizeF
+		Dim nativeFont = getNativeFont(font)
+		Dim nativeFormat = getNativeStringFormat(stringFormat)
+		Dim boundingBox As RectangleF
+		SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, boundingBox, codepointsFitted, linesFilled))
+		measureString.Width = boundingBox.Width
+		measureString.Height = boundingBox.Height
+	End Function
+
+Public
+
+	Function MeasureCharacterRanges(s As String, font As Font, ByRef layoutRect As RectangleF, stringFormat As StringFormat) As System.Collections.Generic.IList<Region>
+		Dim wcs As PCWSTR
+		Dim len = GetStr(s, wcs)
+		MeasureCharacterRanges = MeasureCharacterRanges(wcs, len, font, layoutRect, stringFormat)
+	End Function
+
+	Function MeasureCharacterRanges(str As PCWSTR, length As Long, font As Font, ByRef layoutRect As RectangleF, stringFormat As StringFormat) As System.Collections.Generic.IList<Region>
+		If ActiveBasic.IsNothing(stringFormat) Then
+			stringFormat = New StringFormat
 		End If
-		Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, 0))
-	End Function
-
-	Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
-		stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Status
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeFormat As *GpStringFormat
-		If VarPtr(stringFormat) <> 0 Then
-			nativeFormat = stringFormat.nativeFormat
-		Else
-			nativeFormat = 0
-		End If
-		Dim nativeBrush As *GpBrush
-		If VarPtr(brush) <> 0 Then
-			nativeBrush = brush.nativeFormat
-		Else
-			nativeBrush = 0
-		End If
-		Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat, nativeBrush))
-	End Function
-
-	Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ Point) As Status
-		Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, rect, 0, 0))
-	End Function
-
-	Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
-		brush As /*Const*/ Brush) As Status
-
-		Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeBrush As *GpBrush
-		If VarPtr(brush) <> 0 Then
-			nativeBrush = brush.nativeFormat
-		Else
-			nativeBrush = 0
-		End If
-		Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, rect, 0, nativeBrush))
-	End Function
-
-	Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF) As Status
-		Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, rect, 0, 0))
-	End Function
-
-	Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
-		stringFormat As /*Const*/ StringFormat) As Status
-
-		Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeFormat As *GpStringFormat
-		If VarPtr(stringFormat) <> 0 Then
-			nativeFormat = stringFormat.nativeFormat
-		Else
-			nativeFormat = 0
-		End If
-		Return SetStatus(GdipDrawString(nativeGraphics, str, length, nativeFont, rect, nativeFormat, 0))
-	End Function
-
-	Function DrawString(str As PCWSTR, length As Long, font As /*Const*/ Font, origin As /*Const*/ PointF,
-		stringFormat As /*Const*/ StringFormat, brush As /*Const*/ Brush) As Status
-
-		Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeFormat As *GpStringFormat
-		If VarPtr(stringFormat) <> 0 Then
-			nativeFormat = stringFormat.nativeFormat
-		Else
-			nativeFormat = 0
-		End If
-		If VarPtr(brush) <> 0 Then
-			nativeBrush = brush.nativeFormat
-		Else
-			nativeBrush = 0
-		End If
-		Return SetStatus(GdipDrawString( nativeGraphics, str, length, nativeFont, rect, nativeFormat, nativeBrush))
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
-		stringFormat As /*Const*/ StringFormat, boundingBox As RectangleF) As Status
-
-		Return MeasureString(str, length, font, layoutRect, stringFormat, boundingBox, ByVal 0, ByVal 0)
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
-		stringFormat As /*Const*/ StringFormat, boundingBox As RectangleF,
-		codepointsFitted As Long) As Status
-
-		Return MeasureString(str, length, font, layoutRect, stringFormat, boundingBox, codepointsFitted, ByVal 0)
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font, layoutRect As /*Const*/ RectangleF,
-		stringFormat As /*Const*/ StringFormat, boundingBox As RectangleF,
-		codepointsFitted As Long, linesFilled As Long) As Status
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeFormat As *GpStringFormat
-		If VarPtr(stringFormat) <> 0 Then
-			nativeFormat = stringFormat.nativeFormat
-		Else
-			nativeFormat = 0
-		End If
-		Return SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, layoutRect, nativeFormat,
-			boundingBox, codepointsFitted, linesFilled))
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
-		layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
-		size As SizeF) As Status
-
-			Return MeasureString(str, length, font, layoutRectSize, stringFormat, size, ByVal 0, ByVal 0)
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
-		layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
-		size As SizeF, codepointsFitted As Long) As Status
-
-			Return MeasureString(str, length, font, layoutRectSize, stringFormat, size, codepointsFitted, ByVal 0)
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
-		layoutRectSize As /*Const*/ SizeF, stringFormat As /*Const*/ StringFormat,
-		size As SizeF, codepointsFitted As Long, linesFilled As Long) As Status
-
-		Dim layoutRect As RectangleF(0, 0, layoutRectSize.Width, layoutRectSize.Height)
-		Dim boundingBox As RectangleF, pBoundingBox As *RectangleF
-		If VarPtr(size) <> 0 Then
-			pBoundingBox = VarPtr(boundingBox)
-		Else
-			pBoundingBox = 0
-		End If
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeFormat As *GpStringFormat
-		If VarPtr(stringFormat) <> 0 Then
-			nativeFormat = stringFormat.nativeFormat
-		Else
-			nativeFormat = 0
-		End If
-		Dim status = SetStatus(GdipMeasureString(nativeGraphics, str, length,
-			nativeFont, layoutRect, nativeFormat, pBoundingBox, codepointsFitted, linesFilled))
-
-		If VarPtr(size) <> 0 And status = Status.Ok Then
-			size.Width  = boundingBox.Width
-			size.Height = boundingBox.Height
-		End Function
-
-		Return status
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
-		origin As /*Const*/ PointF, stringFormat As /*Const*/ StringFormat,
-		boundingBox As RectangleF) As Status
-
-		Dim rect As RectangleF(origin.X, origin.Y, 0.0f, 0.0f)
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeFormat As *GpStringFormat
-		If VarPtr(stringFormat) <> 0 Then
-			nativeFormat = stringFormat.nativeFormat
-		Else
-			nativeFormat = 0
-		End If
-
-		Return SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, rect, nativeFormat, boundingBox, 0, 0))
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
-		layoutRect As /*Const*/ RectangleF, boundingBox As RectangleF) As Status
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-
-		Return SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, layoutRect, 0, boundingBox, 0, 0))
-	End Function
-
-	Const Function MeasureString(str As PCWSTR, length As Long, font As /*Const*/ Font,
-		origin As /*Const*/ PointF, boundingBox As RectangleF) As Status
-		Dim rect As RectangleF(origin.X, origin.Y, 0.0, 0.0)
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Return SetStatus(GdipMeasureString(nativeGraphics, str, length, nativeFont, rect, 0, boundingBox, 0, 0))
-	End Function
-
-	Const Function MeasureCharacterRanges(str As PCWSTR, length As Long, font As /*Const*/ Font,
-		layoutRect As /*Const*/ RectangleF, stringFormat As /*Const*/ StringFormat,
-		regionCount As Long, regions As *Region) As Status
-		If regions = 0 Or regionCount <= 0 Then
-			Return InvalidParameter
-		End If
-
-		Dim nativeRegions = _System_malloc(regionCount * SizeOf (GpRegion*)) As **GpRegion
-
-		If nativeRegions = 0 Then
-			Return OutOfMemory
-		End If
+		Dim count As Long
+        SetStatus(GdipGetStringFormatMeasurableCharacterRangeCount(stringFormat.nativeFormat, count))
+		Dim nativeRegions As **GpRegion 'ここで = GC_mallocとすると、エラーになる。
+		nativeRegions = GC_malloc(count * SizeOf(*GpRegion))
+		Dim regions = New System.Collections.Generic.List<Region>(count)
+		MeasureCharacterRanges = regions
 
 		Dim i As Long
-		For i = 0 To regionCount
-			nativeRegions[i] = regions[i].nativeRegion
+		For i = 0 To ELM(count)
+			Dim t = regions[i]
+			nativeRegions[i] = t.nativeRegion
 		Next
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeFormat As *GpStringFormat
-		If VarPtr(stringFormat) <> 0 Then
-			nativeFormat = stringFormat.nativeFormat
-		Else
-			nativeFormat = 0
-		End If
-
-		Dim status = SetStatus(GdipMeasureCharacterRanges(nativeGraphics,
-			str, length, nativeFont, layoutRect, nativeFormat,regionCount, nativeRegions))
-		_System_free(nativeRegions)
-		Return status
-	End Function
-
-	Function DrawDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
-		brush As /*Const*/ Brush, positions As /*Const*/ *PointF, flags As Long) As Status
-
-		Return DrawDriverString(text, length, font, brush, positions, flags, ByVal 0)
-	End Function
-
-	Function DrawDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
-		brush As /*Const*/ Brush, positions As /*Const*/ *PointF, flags As Long, matrix As /*Const*/ Matrix) As Status
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeBrush As *GpBrush
-		If VarPtr(brush) <> 0 Then
-			nativeBrush = brush.nativeBrush
-		Else
-			nativeBrush = 0
-		End If
-		Dim nativeMatrix As *GpMatrix
-		If VarPtr(matrix) <> 0 Then
-			nativeMatrix = matrix.nativeMatrix
-		Else
-			nativeMatrix = 0
-		End If
-		Return SetStatus(GdipDrawDriverString(nativeGraphics, text, length, nativeFont, nativeBrush, positions, flags, nativeMatrix))
-	End Function
-
-	Const Function MeasureDriverString(text As /*Const*/ Word, length As Long, font As /*Const*/ Font,
-		positions As /*Const*/ *PointF, flags As Long, matrix As /*Const*/ Matrix, boundingBox As RectangleF) As Status
-
-		Dim nativeFont As *GpFont
-		If VarPtr(font) <> 0 Then
-			nativeFont = font.nativeFormat
-		Else
-			nativeFont = 0
-		End If
-		Dim nativeMatrix As *GpMatrix
-		If VarPtr(matrix) <> 0 Then
-			nativeMatrix = matrix.nativeMatrix
-		Else
-			nativeMatrix = 0
-		End If
-		Return SetStatus(GdipMeasureDriverString(nativeGraphics, text, length, nativeFont, positions, flags, nativeMatrix, boundingBox))
-	End Function
-
-	' Draw a cached bitmap on this graphics destination offset by
-	' x, y. Note this will fail with WrongState if the CachedBitmap
-	' native format differs from this Graphics.
-
-	Function DrawCachedBitmap(cb As CachedBitmap, x As Long, y As Long) As Status
-		Return SetStatus(GdipDrawCachedBitmap(nativeGraphics, cb->nativeCachedBitmap, x, y))
-	End Function
-
-	Function DrawImage(image As Image, point As /*Const*/ PointF) As Status
-		Return DrawImage(image, point.X, point.Y)
-	End Function
-
-	Function DrawImage(image As Image, x As Single, y As Single) As Status
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Return SetStatus(GdipDrawImage(nativeGraphics, nativeImage, x, y))
-	End Function
-
-	Function DrawImage(image As Image, rect As /*Const*/ RectangleF) As Status
-		Return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function DrawImage(image As Image, x As Single, y As Single, width As Single, height As Single) As Status
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Return SetStatus(GdipDrawImageRect(nativeGraphics, nativeImage, x, y, width, height))
-	End Function
-
-	Function DrawImage(image As Image, point As /*Const*/ Point) As Status
-		Return DrawImage(image, point.X, point.Y) As Status
-	End Function
-
-	Function DrawImage(image As Image, x As Long, y As Long) As Status
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Return SetStatus(GdipDrawImageI(nativeGraphics, nativeImage, x, y))
-	End Function
-
-	Function DrawImage(image As Image, rect As /*Const*/ Rectangle) As Status
-		Return DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height)
-	End Function
-
-	Function DrawImage(image As Image, x As Long, y As Long, width As Long, height As Long) As Status
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Return SetStatus(GdipDrawImageRectI(nativeGraphics, nativeImage, x, y, width, height))
-	End Function
+		Dim nativeFont = getNativeFont(font)
+		SetStatus(GdipMeasureCharacterRanges(nativeGraphics, str, length, nativeFont, layoutRect, stringFormat.nativeFormat, count, nativeRegions))
+	End Function
+
+	'DrawDriverString
+	'MeasureDriverString
+
+	Sub DrawCachedBitmap(cb As CachedBitmap, x As Long, y As Long)
+		SetStatus(GdipDrawCachedBitmap(nativeGraphics, cb.nativeCachedBitmap, x, y))
+	End Sub
+
+	Sub DrawImage(image As Image, ByRef point As PointF)
+		DrawImage(image, point.X, point.Y)
+	End Sub
+
+	Sub DrawImage(image As Image, x As Single, y As Single)
+		Dim nativeImage = getNativeImage(image)
+		SetStatus(GdipDrawImage(nativeGraphics, nativeImage, x, y))
+	End Sub
+
+	Sub DrawImage(image As Image, ByRef rect As RectangleF)
+		DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub DrawImage(image As Image, x As Single, y As Single, width As Single, height As Single)
+		Dim nativeImage = getNativeImage(image)
+		SetStatus(GdipDrawImageRect(nativeGraphics, nativeImage, x, y, width, height))
+	End Sub
+
+	Sub DrawImage(image As Image, ByRef point As Point)
+		DrawImage(image, point.X, point.Y)
+	End Sub
+
+	Sub DrawImage(image As Image, x As Long, y As Long)
+		Dim nativeImage = getNativeImage(image)
+		SetStatus(GdipDrawImageI(nativeGraphics, nativeImage, x, y))
+	End Sub
+
+	Sub DrawImage(image As Image, ByRef rect As Rectangle)
+		DrawImage(image, rect.X, rect.Y, rect.Width, rect.Height)
+	End Sub
+
+	Sub DrawImage(image As Image, x As Long, y As Long, width As Long, height As Long)
+		Dim nativeImage = getNativeImage(image)
+		SetStatus(GdipDrawImageRectI(nativeGraphics, nativeImage, x, y, width, height))
+	End Sub
 
 	' Affine Draw Image
@@ -1112,901 +825,444 @@
 	'	   destPoints[3] <=> bottom-right corner
 
-	Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long) As Status
+	Sub DrawImage(image As Image, destPoints As *PointF, count As Long)
 		If count <> 3 And count <> 4 Then
-			Return SetStatus(InvalidParameter)
+			SetStatus(InvalidParameter)
 		End If
 
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
+		Dim nativeImage = getNativeImage(image)
+		SetStatus(GdipDrawImagePoints(nativeGraphics, nativeImage, destPoints, count))
+	End Sub
+
+	Sub DrawImage(image As Image, destPoints As *Point, count As Long)
+		If count <> 3 And count <> 4 Then
+			SetStatus(InvalidParameter)
 		End If
-		Return SetStatus(GdipDrawImagePoints(nativeGraphics, nativeImage, destPoints, count))
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long) As Status
-		If count <> 3 And count <> 4 Then
-			Return SetStatus(InvalidParameter)
-		End If
-
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Return SetStatus(GdipDrawImagePointsI(nativeGraphics, nativeImage, destPoints, count))
-	End Function
-
-	Function DrawImage(image As Image, x As Single, y As Single,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Status
-
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Return SetStatus(GdipDrawImagePointRect(nativeGraphics, nativeImage, x, y, srcx, srcy, srcwidth, srcheight, srcUnit))
-	End Function
-
-	Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Status
-
-		Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
-	End Function
-
-	Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
+
+		Dim nativeImage = getNativeImage(image)
+		SetStatus(GdipDrawImagePointsI(nativeGraphics, nativeImage, destPoints, count))
+	End Sub
+
+	Sub DrawImage(image As Image, ByRef destRect As Rectangle, ByRef src As Rectangle, srcUnit As GraphicsUnit)
+		DrawImage(image, destRect, src.X, src.Y, src.Width, src.Height, srcUnit)
+	End Sub
+
+	Sub DrawImage(image As Image, ByRef destRect As RectangleF, ByRef src As RectangleF, srcUnit As GraphicsUnit)
+		DrawImage(image, destRect, src.X, src.Y, src.Width, src.Height, srcUnit)
+	End Sub
+
+	Sub DrawImage(image As Image, x As Long, y As Long, ByRef src As Rectangle, srcUnit As GraphicsUnit)
+		Dim nativeImage = getNativeImage(image)
+		SetStatus(GdipDrawImagePointRectI(nativeGraphics, nativeImage, x, y, src.X, src.Y, src.Width, src.Height, srcUnit))
+	End Sub
+
+	Sub DrawImage(image As Image, x As Single, y As Single, ByRef src As RectangleF, srcUnit As GraphicsUnit)
+		Dim nativeImage = getNativeImage(image)
+		SetStatus(GdipDrawImagePointRect(nativeGraphics, nativeImage, x, y, src.X, src.Y, src.Width, src.Height, srcUnit))
+	End Sub
+
+	Sub DrawImage(image As Image, destPoints As *Point, count As Long, ByRef src As Rectangle, srcUnit As GraphicsUnit, _
+		imageAttr = Nothing As ImageAttributes, callback = Nothing As DrawImageAbort, callbackData = 0 As VoidPtr)
+
+		Dim nativeImage = getNativeImage(image)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		SetStatus(GdipDrawImagePointsRectI(nativeGraphics, nativeImage, destPoints, count,
+			src.X, src.Y, src.Width, src.Height, srcUnit, nativeImageAttr, callback, callbackData))
+	End Sub
+
+	Sub DrawImage(image As Image, destPoints As *PointF, count As Long, ByRef src As RectangleF, srcUnit As GraphicsUnit,
+		imageAttr = Nothing As ImageAttributes, callback = Nothing As DrawImageAbort, callbackData = 0 As VoidPtr)
+
+		Dim nativeImage = getNativeImage(image)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		SetStatus(GdipDrawImagePointsRect(nativeGraphics, nativeImage, destPoints, count,
+			src.X, src.Y, src.Width, src.Height, srcUnit, nativeImageAttr, callback, callbackData))
+	End Sub
+
+	Sub DrawImage(image As Image, ByRef destRect As RectangleF,
 		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
-	End Function
-
-	Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes,
-		callback As DrawImageAbort) As Status
-
-		Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
-	End Function
-
-	Function DrawImage(image As Image, destRect As /*Const*/ RectangleF,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Status
-
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipDrawImageRectRect(nativeGraphics, nativeImageAttr,
+		imageAttr = Nothing As ImageAttributes, callback = Nothing As DrawImageAbort, callbackData = 0 As VoidPtr)
+
+		Dim nativeImage = getNativeImage(image)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		SetStatus(GdipDrawImageRectRect(nativeGraphics, nativeImageAttr,
 			destRect.X, destRect.Y, destRect.Width, destRect.Height, srcx, srcy, srcwidth, srcheight,
 			srcUnit, nativeImageAttr, callback, callbackData))
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Status
-
-		Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes,
-		callback As DrawImageAbort) As Status
-
-		Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ PointF, count As Long,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Status
-
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipDrawImagePointsRect(nativeGraphics, nativeImage, destPoints, count,
-			srcx, srcy, srcwidth, srcheight, srcUnit, nativeImageAttr, callback, callbackData))
-	End Function
-
-	Function DrawImage(image As Image, x As Long, y As Long,
-		srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit) As Status
-
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Return SetStatus(GdipDrawImagePointRectI(nativeGraphics, nativeImage, x, y, srcx, srcy, srcwidth, srcheight, srcUnit))
-	End Function
-
-	Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit) As Status
-
-		Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
-	End Function
-
-	Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
-	End Function
-
-	Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
-		srcx As Single, srcy As Single, srcwidth As Single, srcheight As Single, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort) As Status
-
-		Return DrawImage(image, destRect, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
-	End Function
-
-	Function DrawImage(image As Image, destRect As /*Const*/ Rectangle,
+	End Sub
+
+	Sub DrawImage(image As Image, ByRef destRect As Rectangle,
 		srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Status
-
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipDrawImageRectRectI(nativeGraphics, nativeImage,
+		imageAttr = Nothing As ImageAttributes, callback = Nothing As DrawImageAbort, callbackData = 0 As VoidPtr)
+
+		Dim nativeImage = getNativeImage(image)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		SetStatus(GdipDrawImageRectRectI(nativeGraphics, nativeImage,
 			destRect.X, destRect.Y, destRect.Width, destRect.Height,
 			srcx, srcy, srcwidth, srcheight, srcUnit, nativeImageAttr, callback, callbackData))
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
-		srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit) As Status
-
-		Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, 0, 0, 0)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
-		srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, 0, 0)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long, _
-		srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit, _
-		imageAttributes As /*Const*/ ImageAttributes,
-		callback As DrawImageAbort) As Status
-
-		Return DrawImage(image, destPoints, count, srcx, srcy, srcwidth, srcheight, srcUnit, imageAttributes, callback, 0)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ Point, count As Long,
-		srcx As Long, srcy As Long, srcwidth As Long, srcheight As Long, srcUnit As GraphicsUnit,
-		imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Status
-
-		Dim nativeImage As *GpImage
-		If VarPtr(image) <> 0 Then
-			nativeImage = image.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipDrawImagePointsRectI(nativeGraphics, nativeImage, destPoints, count,
-			srcx, srcy, srcwidth, srcheight, srcUnit, nativeImageAttr, callback, callbackData))
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit) As Status
-		Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit) As Status
-		Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
-	End Function
-
-	Function DrawImage(image As Image, x As Long, y As Long, srcRect As Rectangle, srcUnit As GraphicsUnit) As Status
-		Return DrawImage(image, x, y, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
-	End Function
-
-	Function DrawImage(image As Image, x As Single, y As Single, srcRect As RectangleF, srcUnit As GraphicsUnit) As Status
-		Return DrawImage(image, x, y, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes) As Status
-		Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes) As Status
-		Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort) As Status
-		Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort) As Status
-		Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ *Point, count As Long, srcRect As Rectangle, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Status
-		Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback, callbackData)
-	End Function
-
-	Function DrawImage(image As Image, destPoints As /*Const*/ *PointF, count As Long, srcRect As RectangleF, srcUnit As GraphicsUnit, imageAttributes As /*Const*/ ImageAttributes, callback As DrawImageAbort, callbackData As VoidPtr) As Status
-		Return DrawImage(image, destPoints, count, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, srcUnit, imageAttributes, callback, callbackData)
-	End Function
-
-	' The following methods are for playing an EMF+ to a graphics
-	' via the enumeration interface.  Each record of the EMF+ is
-	' sent to the callback (along with the callbackData).	Then
-	' the callback can invoke the Metafile::PlayRecord method
-	' to play the particular record.
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destPoint, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destPoint, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ PointF,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileDestPoint(nativeGraphics,
-			nativeImage, destPoint, callback, callbackData,nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destPoint, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destPoint, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoint As /*Const*/ Point,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileDestPointI(nativeGraphics,
-			nativeImage, destPoint, callback, callbackData,nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destRect, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destRect, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ RectangleF,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileDestRect(nativeGraphics,
-			nativeImage, destRect, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destRect, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destRect, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destRect As /*Const*/ Rectangle,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileDestRectI(nativeGraphics,
-			nativeImage, destRect, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destPoints, count, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destPoints, count, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *PointF, count As Long,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileDestPoints(nativeGraphics,
-			nativeImage,destPoints, count, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destPoints, count, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destPoints, count, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, destPoints As /*Const*/ *Point, count As Long,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileDestPointsI(nativeGraphics,
-			nativeImage,destPoints, count, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile,
-		destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destPoint, count, srcUnit, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile,
-		destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destPoint, srcRect, srcUnit, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile,
-		destPoint As /*Const*/ PointF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit,
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileSrcRectDestPoint(nativeGraphics, _
-			nativeImage, destPoint, srcRect, srcUnit, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destPoint, count, srcUnit, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destPoint, srcRect, srcUnit, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoint As /*Const*/ Point, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileSrcRectDestPointI(nativeGraphics, _
-			nativeImage, destPoint, srcRect, srcUnit, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destRect, count, srcUnit, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destRect As /*Const*/ RectangleF, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileSrcRectDestRect(nativeGraphics, _
-			nativeImage, destRect, srcRect, srcUnit, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destRect, srcRect, srcUnit, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destRect As /*Const*/ Rectangle, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileSrcRectDestRectI(nativeGraphics, _
-			nativeImage, destRect, srcRect, srcUnit, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoints As /*Const*/ *PointF, count As Long, srcRect As /*Const*/ RectangleF, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileSrcRectDestPoints(nativeGraphics, _
-			nativeImage, destPoints, count, srcRect, srcUnit, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc) As Status
-
-		Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, 0, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr) As Status
-
-		Return EnumerateMetafile(metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, 0)
-	End Function
-
-	Function EnumerateMetafile(metafile As /*Const*/ Metafile, _
-		destPoints As /*Const*/ *Point, count As Long, srcRect As /*Const*/ Rectangle, srcUnit As GraphicsUnit, _
-		callback As EnumerateMetafileProc, callbackData As VoidPtr, imageAttributes As /*Const*/ ImageAttributes) As Status
-
-		Dim nativeImage As /*Const*/ *GpMetafile
-		If VarPtr(metafile) <> 0 Then
-			nativeImage = metafile.NativeImage
-		Else
-			nativeImage = 0
-		End If
-		Dim nativeImageAttr As *GpImageAttributes
-		If VarPtr(imageAttributes) <> 0 Then
-			nativeImageAttr = image.NativeImageAttr
-		Else
-			nativeImageAttr = 0
-		End If
-
-		Return SetStatus(GdipEnumerateMetafileSrcRectDestPointsI(nativeGraphics, nativeImage, _
-			destPoints, count, srcRect, srcUnit, callback, callbackData, nativeImageAttr))
-	End Function
-
-	Function SetClip(g As /*Const*/ Graphics) As Status
-		Return SetClip(g, CombineMode.Replace)
-	End Function
-
-	Function SetClip(rc As /*Const*/ RectangleF) As Status
-		Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Replace))
-	End Function
-
-	Function SetClip(rc As /*Const*/ Rectangle) As Status
-		Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Replace))
-	End Function
-
-	Function SetClip(path As /*Const*/ GraphicsPath) As Status
-		Return SetStatus(GdipSetClipPath(nativeGraphics, path->nativePath, CombineMode.Replace))
-	End Function
-
-	Function SetClip(region As /*Const*/ Region) As Status
-		Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Replace))
-	End Function
-
-	Function SetClip(g As /*Const*/ Graphics, combineMode As CombineMode) As Status
-		Return SetStatus(GdipSetClipGraphics(nativeGraphics, g->nativeGraphics, combineMode))
-	End Function
-
-	Function SetClip(rc As /*Const*/ RectangleF, combineMode As CombineMode) As Status
-		Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, combineMode))
-	End Function
-
-	Function SetClip(rc As /*Const*/ Rectangle, combineMode As CombineMode) As Status
-		Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, combineMode))
-	End Function
-
-	Function SetClip(path As /*Const*/ GraphicsPath, combineMode As CombineMode) As Status
-		Return SetStatus(GdipSetClipPath(nativeGraphics, path->nativePath, combineMode))
-	End Function
-
-	Function SetClip(region As /*Const*/ Region, combineMode As CombineMode) As Status
-		Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, combineMode))
-	End Function
-
-	' This is different than the other SetClip methods because it assumes
-	' that the HRGN is already in device units, so it doesn't transform
-	' the coordinates in the HRGN.
-
-	Function SetClip(hrgn As HRGN, combineMode As CombineMode /* = CombineModeReplace*/) As Status
-		Return SetStatus(GdipSetClipHrgn(nativeGraphics, hrgn, combineMode))
-	End Function
-
-	Function IntersectClip(rc As /*Const*/ RectangleF) As Status
-		Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Intersect))
-	End Function
-
-	Function IntersectClip(rc As /*Const*/ Rectangle) As Status
-		Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Intersect))
-	End Function
-
-	Function IntersectClip(region As /*Const*/ Region) As Status
-		Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Intersect))
-	End Function
-
-	Function ExcludeClip(rc As /*Const*/ RectangleF) As Status
-		Return SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Exclude))
-	End Function
-
-	Function ExcludeClip(rc As /*Const*/ Rectangle) As Status
-		Return SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, CombineMode.Exclude))
-	End Function
-
-	Function ExcludeClip(region As /*Const*/ Region) As Status
-		Return SetStatus(GdipSetClipRegion(nativeGraphics, region->nativeRegion, CombineMode.Exclude))
-	End Function
-
-	Function ResetClip() As Status
-		Return SetStatus(GdipResetClip(nativeGraphics))
-	End Function
-
-	Function TranslateClip(dx As Single, dy As Single) As Status
-		Return SetStatus(GdipTranslateClip(nativeGraphics, dx, dy))
-	End Function
-
-	Function TranslateClip(dx As Long, dy As Long) As Status
-		Return SetStatus(GdipTranslateClipI(nativeGraphics, dx, dy))
-	End Function
-
-	Const Function GetClip(region As Region) As Status
-		Return SetStatus(GdipGetClip(nativeGraphics, region->nativeRegion))
-	End Function
-
-	Const Function GetClipBounds(rc As RectangleF) As Status
-		Return SetStatus(GdipGetClipBounds(nativeGraphics, rc))
-	End Function
-
-	Const Function GetClipBounds(rc As Rectangle) As Status
-		Return SetStatus(GdipGetClipBoundsI(nativeGraphics, rc))
-	End Function
-
-	Const Function GetVisibleClipBounds(rc As RectangleF) As Status
-		Return SetStatus(GdipGetVisibleClipBounds(nativeGraphics, rc))
-	End Function
-
-	Const Function GetVisibleClipBounds(rc As Rectangle) As Status
-		Return SetStatus(GdipGetVisibleClipBoundsI(nativeGraphics, rc))
-	End Function
-
-	Const Function IsVisible(x As Long, y As Long) As BOOL
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile, ByRef destPoint As PointF,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileDestPoint(nativeGraphics,
+			nativeImage, destPoint, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile, ByRef destPoint As Point,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileDestPointI(nativeGraphics,
+			nativeImage, destPoint, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile, ByRef destRect As RectangleF,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileDestRect(nativeGraphics,
+			nativeImage, destRect, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile, ByRef destRect As Rectangle,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileDestRectI(nativeGraphics,
+			nativeImage, destRect, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile, destPoints As *PointF, count As Long,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileDestPoints(nativeGraphics,
+			nativeImage,destPoints, count, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile, destPoints As *Point, count As Long,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileDestPointsI(nativeGraphics,
+			nativeImage,destPoints, count, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile,
+		ByRef destPoint As PointF, ByRef srcRect As RectangleF, srcUnit As GraphicsUnit,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileSrcRectDestPoint(nativeGraphics,
+			nativeImage, destPoint, srcRect, srcUnit, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile,
+		ByRef destPoint As Point, ByRef srcRect As Rectangle, srcUnit As GraphicsUnit,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileSrcRectDestPointI(nativeGraphics,
+			nativeImage, destPoint, srcRect, srcUnit, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile,
+		ByRef destRect As RectangleF, ByRef srcRect As RectangleF, srcUnit As GraphicsUnit,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileSrcRectDestRect(nativeGraphics,
+			nativeImage, destRect, srcRect, srcUnit, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile,
+		ByRef destRect As Rectangle, ByRef srcRect As Rectangle, srcUnit As GraphicsUnit,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileSrcRectDestRectI(nativeGraphics,
+			nativeImage, destRect, srcRect, srcUnit, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile,
+		destPoints As *PointF, count As Long, ByRef srcRect As RectangleF, srcUnit As GraphicsUnit,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileSrcRectDestPoints(nativeGraphics,
+			nativeImage, destPoints, count, srcRect, srcUnit, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub EnumerateMetafile(metafile As Metafile,
+		destPoints As *Point, count As Long, ByRef srcRect As Rectangle, srcUnit As GraphicsUnit,
+		callback As EnumerateMetafileProc, callbackData = 0 As VoidPtr, imageAttr = Nothing As ImageAttributes)
+
+		Dim nativeImage = getNativeImage(metafile)
+		Dim nativeImageAttr = getNativeImageAttributes(imageAttr)
+		Dim procData As Detail.EnumerateMetafileProcData
+		procData.Proc = callback
+		procData.Data = callbackData
+		SetStatus(GdipEnumerateMetafileSrcRectDestPointsI(nativeGraphics, nativeImage,
+			destPoints, count, srcRect, srcUnit, AddressOf(Detail.NativeEnumerateMetafileProcEntry), VarPtr(procData), nativeImageAttr))
+	End Sub
+
+	Sub SetClip(g As Graphics)
+		SetClip(g, System.Drawing.Drawing2D.CombineMode.Replace)
+	End Sub
+
+	Sub SetClip(g As Graphics, combineMode As Drawing2D.CombineMode)
+		SetStatus(GdipSetClipGraphics(nativeGraphics, g.nativeGraphics, combineMode))
+	End Sub
+
+	Sub SetClip(ByRef rc As RectangleF)
+		SetClip(rc, System.Drawing.Drawing2D.CombineMode.Replace)
+	End Sub
+
+	Sub SetClip(ByRef rc As RectangleF, combineMode As Drawing2D.CombineMode)
+		SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, combineMode))
+	End Sub
+
+	Sub SetClip(ByRef rc As Rectangle)
+		SetClip(rc, System.Drawing.Drawing2D.CombineMode.Replace)
+	End Sub
+
+	Sub SetClip(ByRef rc As Rectangle, combineMode As Drawing2D.CombineMode)
+		SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, combineMode))
+	End Sub
+
+	Sub SetClip(path As GraphicsPath)
+		SetClip(path, System.Drawing.Drawing2D.CombineMode.Replace)
+	End Sub
+
+	Sub SetClip(path As GraphicsPath, combineMode As Drawing2D.CombineMode)
+		SetStatus(GdipSetClipPath(nativeGraphics, path.nativePath, combineMode))
+	End Sub
+
+	Sub SetClip(region As Region)
+		SetClip(region, System.Drawing.Drawing2D.CombineMode.Replace)
+	End Sub
+
+	Sub SetClip(region As Region, combineMode As Drawing2D.CombineMode)
+		SetStatus(GdipSetClipRegion(nativeGraphics, region.nativeRegion, combineMode))
+	End Sub
+
+	Sub SetClip(hrgn As HRGN)
+		SetClip(hrgn, System.Drawing.Drawing2D.CombineMode.Replace)
+	End Sub
+
+	Sub SetClip(hrgn As HRGN, combineMode As Drawing2D.CombineMode)
+		SetStatus(GdipSetClipHrgn(nativeGraphics, hrgn, combineMode))
+	End Sub
+
+	Sub IntersectClip(ByRef rc As RectangleF)
+		SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, System.Drawing.Drawing2D.CombineMode.Intersect))
+	End Sub
+
+	Sub IntersectClip(ByRef rc As Rectangle)
+		SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, System.Drawing.Drawing2D.CombineMode.Intersect))
+	End Sub
+
+	Sub IntersectClip(region As Region)
+		SetStatus(GdipSetClipRegion(nativeGraphics, region.nativeRegion, System.Drawing.Drawing2D.CombineMode.Intersect))
+	End Sub
+
+	Sub ExcludeClip(ByRef rc As RectangleF)
+		SetStatus(GdipSetClipRect(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, System.Drawing.Drawing2D.CombineMode.Exclude))
+	End Sub
+
+	Sub ExcludeClip(ByRef rc As Rectangle)
+		SetStatus(GdipSetClipRectI(nativeGraphics, rc.X, rc.Y, rc.Width, rc.Height, System.Drawing.Drawing2D.CombineMode.Exclude))
+	End Sub
+
+	Sub ExcludeClip(region As Region)
+		SetStatus(GdipSetClipRegion(nativeGraphics, region.nativeRegion, System.Drawing.Drawing2D.CombineMode.Exclude))
+	End Sub
+
+	Sub ResetClip()
+		SetStatus(GdipResetClip(nativeGraphics))
+	End Sub
+
+	Sub TranslateClip(dx As Single, dy As Single)
+		SetStatus(GdipTranslateClip(nativeGraphics, dx, dy))
+	End Sub
+
+	Sub TranslateClip(dx As Long, dy As Long)
+		SetStatus(GdipTranslateClipI(nativeGraphics, dx, dy))
+	End Sub
+
+	Const Function IsVisible(x As Long, y As Long) As Boolean
 		Dim b = FALSE As BOOL
 		SetStatus(GdipIsVisiblePointI(nativeGraphics, x, y, b))
-		Return b
-	End Function
-
-	Const Function IsVisible(pt As /*Const*/ Point) As BOOL
-		Return IsVisible(pt.X, pt.Y)
-	End Function
-
-	Const Function IsVisible(x As Long, y As Long, width As Long, height As Long) As BOOL
+		IsVisible = b As Boolean
+	End Function
+
+	Const Function IsVisible(ByRef pt As Point) As Boolean
+		IsVisible(pt.X, pt.Y)
+	End Function
+
+	Const Function IsVisible(x As Long, y As Long, width As Long, height As Long) As Boolean
 		Dim b = FALSE As BOOL
 		SetStatus(GdipIsVisibleRectI(nativeGraphics, x, y, width, height, b))
-		Return b
-	End Function
-
-	Const Function IsVisible(rc As /*Const*/ Rectangle) As BOOL
-		Return IsVisible(rc.X, rc.Y, rc.Width, rc.Height)
-	End Function
-
-	Const Function IsVisible(x As Single, y As Single) As BOOL
+		IsVisible = b As Boolean
+	End Function
+
+	Const Function IsVisible(ByRef rc As Rectangle) As Boolean
+		IsVisible = IsVisible(rc.X, rc.Y, rc.Width, rc.Height)
+	End Function
+
+	Const Function IsVisible(x As Single, y As Single) As Boolean
 		Dim b = FALSE As BOOL
 		SetStatus(GdipIsVisiblePoint(nativeGraphics, x, y, b))
-		Return b
-	End Function
-
-	Const Function IsVisible(point As /*Const*/ PointF) As BOOL
-		Return IsVisible(pt.X, pt.Y)
-	End Function
-
-	Const Function IsVisible(x As Single, y As Single, width As Single, height As Single) As BOOL
+		IsVisible = b As Boolean
+	End Function
+
+	Const Function IsVisible(ByRef pt As PointF) As Boolean
+		IsVisible = IsVisible(pt.X, pt.Y)
+	End Function
+
+	Const Function IsVisible(x As Single, y As Single, width As Single, height As Single) As Boolean
 		Dim b = FALSE As BOOL
 		SetStatus(GdipIsVisibleRect(nativeGraphics, x, y, width, height, b))
-		Return b
-	End Function
-
-	Const Function IsVisible(rect As /*Const*/ RectangleF) As BOOL
-		Return IsVisible(rc.X, rc.Y, rc.Width, rc.Height)
-	End Function
-
-	Const Function Save() As GraphicsState
-		Dim gstate As GraphicsState
-		SetStatus(GdipSaveGraphics(nativeGraphics, state))
-		Return gstate
-	End Function
-
-	Function Restore(gstate As GraphicsState)
-		Return SetStatus(GdipRestoreGraphics(nativeGraphics, gstate))
-	End Function
-
-	Function BeginContainer(dstrect As /*Const*/ RectangleF, srcrect As /*Const*/ RectangleF, unit As GraphicsUnit) As GraphicsContainer
-		Dim state As GraphicsContainer
-		SetStatus(GdipBeginContainer(nativeGraphics, dstrect, srcrect, unit, state))
-		Return state
-	End Function
-
-	Function BeginContainer(dstrect As /*Const*/ Rectangle, srcrect As /*Const*/ Rectangle, unit As GraphicsUnit) As GraphicsContainer
-		Dim state As GraphicsContainer
-		SetStatus(GdipBeginContainerI(nativeGraphics, dstrect, srcrect, unit, state))
-		Return state
-	End Function
-
-	Function BeginContainer() As GraphicsContainer
-		Dim state As GraphicsContainer
-		SetStatus(GdipBeginContainer2(nativeGraphics, state))
-		Return state
-	End Function
-
-	Function EndContainer(state As GraphicsContainer) As Status
-		Return SetStatus(GdipEndContainer(nativeGraphics, state))
-	End Function
-
-	' Only valid when recording metafiles.
-
-	Function AddMetafileComment(data As /*Const*/ *Byte, sizeData As DWord)
-		Return SetStatus(GdipComment(nativeGraphics, sizeData, data))
-	End Function
+		IsVisible = b As Boolean
+	End Function
+
+	Const Function IsVisible(ByRef rc As RectangleF) As Boolean
+		IsVisible = IsVisible(rc.X, rc.Y, rc.Width, rc.Height)
+	End Function
+
+	Const Function Save() As Drawing2D.GraphicsState
+		SetStatus(GdipSaveGraphics(nativeGraphics, Save))
+	End Function
+
+	Sub Restore(gstate As Drawing2D.GraphicsState)
+		SetStatus(GdipRestoreGraphics(nativeGraphics, gstate))
+	End Sub
+
+	Function BeginContainer(ByRef dstrect As RectangleF, ByRef srcrect As RectangleF, unit As GraphicsUnit) As Drawing2D.GraphicsContainer
+		SetStatus(GdipBeginContainer(nativeGraphics, dstrect, srcrect, unit, BeginContainer))
+	End Function
+
+	Function BeginContainer(ByRef dstrect As Rectangle, ByRef srcrect As Rectangle, unit As GraphicsUnit) As Drawing2D.GraphicsContainer
+		SetStatus(GdipBeginContainerI(nativeGraphics, dstrect, srcrect, unit, BeginContainer))
+	End Function
+
+	Function BeginContainer() As Drawing2D.GraphicsContainer
+		SetStatus(GdipBeginContainer2(nativeGraphics, BeginContainer))
+	End Function
+
+	Sub EndContainer(state As Drawing2D.GraphicsContainer)
+		SetStatus(GdipEndContainer(nativeGraphics, state))
+	End Sub
+
+	Sub AddMetafileComment(data As *Byte, sizeData As DWord)
+		SetStatus(GdipComment(nativeGraphics, sizeData, data))
+	End Sub
 
 	Static Function GetHalftonePalette() As HPALETTE
-		Return GdipCreateHalftonePalette()
-	End Function
-
-	Const Function GetLastStatus() As Status
-		Dim lastStatus = lastResult
-		lastResult = Status.Ok
-		Return lastStatus
-	End Function
+		GdipCreateHalftonePalette()
+	End Function
+
+	Function NativeGraphics() As *GpGraphics
+		NativeGraphics = nativeGraphics
+	End Function
+
+	Sub Graphics(graphics As *GpGraphics)
+		nativeGraphics = graphics
+	End Sub
 
 Private
-'	Sub Graphics(gr As Graphics)
-'		Debug
-'	End Sub
-	Sub Operator =(gr As Graphics)
-		Debug
-	End Sub
-
-Protected
-	Sub Graphics(graphics As *GpGraphics)
-		lastResult = Status.Ok
-		SetNativeGraphics(graphics)
-	End Sub
-
-	Sub SetNativeGraphics(graphics As *GpGraphics)
-		This.nativeGraphics = graphics
-	End Sub
-
-	Const Function SetStatus(status As Status) As Status
-		If status <> Status.Ok Then
-			lastResult = status
+	Static Function getNativePen(pen As Pen) As *GpPen
+		If ActiveBasic.IsNothing(pen) Then
+			getNativePen = 0
+		Else
+			getNativePen = pen.NativePen
 		End If
-		Return status
-	End Function
-
-	Const Function GetNativeGraphics() As *GpGraphics
-		Return This.nativeGraphics
-	End Function
-
-	Function GetNativePen(pen As /*Const*/ *Pen) As *GpPen
-		Return pen->nativePen
-	End Function
-
-Protected
+	End Function
+
+	Static Function getNativeStringFormat(sf As StringFormat) As *GpStringFormat
+		If ActiveBasic.IsNothing(sf) Then
+			getNativeStringFormat = 0
+		Else
+			getNativeStringFormat = sf.nativeFormat
+		End If
+	End Function
+
+	Static Function getNativeBrush(br As Brush) As *GpBrush
+		If ActiveBasic.IsNothing(br) Then
+			getNativeBrush = 0
+		Else
+			getNativeBrush = br.nativeBrush
+		End If
+	End Function
+
+	Static Function getNativeFont(font As Font) As *GpFont
+		If ActiveBasic.IsNothing(font) Then
+			getNativeFont = 0
+		Else
+			getNativeFont = font.NativeFont
+		End If
+	End Function
+
+	Static Function getNativeImage(image As Image) As *GpImage
+		If ActiveBasic.IsNothing(image) Then
+			getNativeImage = 0
+		Else
+			getNativeImage = image.nativeImage
+		End If
+	End Function
+
+	Static Function getNativeImageAttributes(imageAttr As ImageAttributes) As *GpImageAttributes
+		If ActiveBasic.IsNothing(imageAttr) Then
+			getNativeImageAttributes = 0
+		Else
+			getNativeImageAttributes = imageAttr.nativeImage
+		End If
+	End Function
+
 	nativeGraphics As *GpGraphics
-	lastResult As /*Mutable*/ Status
 End Class
 
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/MetafileHeader.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/MetafileHeader.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/MetafileHeader.ab	(revision 698)
@@ -46,6 +46,5 @@
 Const GDIP_EMFPLUSFLAGS_DISPLAY      = &h00000001
 
-Class MetafileHeader
-Private
+Type MetafileHeader
 	mfType As MetafileType
 	Size As DWord
@@ -65,4 +64,5 @@
 	logicalDpiX As Long
 	logicalDpiY As Long
+/*
 Public
 	Function MetafileType() As MetafileType
@@ -91,6 +91,8 @@
 
 	Function Bounds() As Rectangle
-		Dim r(X, Y, Width, Height)
-		Return r
+		Bounds.X = X
+		Bounds.Y = Y
+		Bounds.Width = Width
+		Bounds.Height = Height
 	End Function
 
@@ -127,5 +129,5 @@
 	End Function
 
-	Function IsEmfPlusOnly() As BOOL /*const*/
+	Function IsEmfPlusOnly() As BOOL
 		IsEmfPlusOnly = (mfType = MetafileTypeEmfPlusOnly)
 	End Function
@@ -133,7 +135,8 @@
 	Function IsDisplay() As BOOL
 		If IsEmfPlus() <> FALSE And ((EmfPlusFlags And GDIP_EMFPLUSFLAGS_DISPLAY) <> 0) Then
-			IsDisplay = _System_TRUE
+			IsDisplay = TRUE
 		Else
-			IsDisplay = _System_FALSE
+			IsDisplay = FALSE
+		End If
 	End Function
 
@@ -146,5 +149,5 @@
 	End Function
 
-	Function GetEmfHeader() As * /*const*/ ENHMETAHEADER3 /*const*/
+	Function GetEmfHeader() As *ENHMETAHEADER3
 		If IsEmfOrEmfPlus() Then
 			Return VarPtr(EmfHeader) 'VarPtr(WmfHeader)
@@ -153,5 +156,6 @@
 		End If
 	End Function
-End Class
+*/
+End Type
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/misc.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/misc.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/misc.ab	(revision 698)
@@ -1,10 +1,10 @@
 ' Classes/System/Drawing/Imaging/misc.ab
+
+TypeDef ARGB = DWord
+TypeDef ARGB64 = QWord
 
 Namespace System
 Namespace Drawing
 Namespace Imaging
-
-TypeDef ARGB = DWord
-TypeDef ARGB64 = QWord
 
 Enum ColorMode
@@ -137,5 +137,5 @@
 Type Align(8) EncoderParameters
 	Count As DWord
-	Parameter[1] As EncoderParameter
+	Parameter[0] As EncoderParameter
 End Type
 
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Pen.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Pen.ab	(revision 698)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Pen.ab	(revision 698)
@@ -0,0 +1,277 @@
+' Classes/System/Drawing/Pen.ab
+
+Namespace System
+Namespace Drawing
+
+Namespace Drawing2D
+Class CustomLineCap
+Public 
+	Function NativeCap() As *GpCustomLineCap
+	End Function
+End Class
+End Namespace
+
+Class Pen
+	Implements IDisposable, ICloneable
+Public
+	Sub Pen(native As *GpPen)
+		nativePen = native
+	End Sub
+
+	Sub Pen(color As Color, width = 1.0 As Single)
+		SetStatus(GdipCreatePen1(color, width, 0 /*GraphicsUnit.World As GpUnit*/, nativePen))
+	End Sub
+
+	Sub Pen(brush As Brush, width = 1.0 As Single)
+		If ActiveBasic.IsNothing(brush) Then
+			Throw New ArgumentNullException("brush")
+		End If
+		SetStatus(GdipCreatePen2(brush.nativeBrush, width, 0 /*GraphicsUnit.World As GpUnit*/, nativePen))
+	End Sub
+
+	Sub Dispose()
+		If nativePen <> 0 Then
+			GdipDeletePen(nativePen)
+		End If
+		nativePen = 0
+	End Sub
+
+	Sub ~Pen()
+		Dispose()
+	End Sub
+
+	Function Clone() As Pen
+		Dim cloned As *GpPen
+		SetStatus(GdipClonePen(nativePen, cloned))
+		Clone = New Pen(cloned)
+	End Function
+
+	Function NativePen() As *GpPen
+		NativePen = nativePen
+	End Function
+
+	'=========================================================================
+	' Properties
+	'=========================================================================
+
+	Sub Width(width As Single)
+		SetStatus(GdipSetPenWidth(nativePen, width))
+	End Sub
+
+	Function Width() As Single
+        SetStatus(GdipGetPenWidth(nativePen, Width))
+	End Function
+
+	Sub StartCap(cap As Drawing2D.LineCap)
+		SetStatus(GdipSetPenStartCap(nativePen, cap))
+	End Sub
+/*
+	Function StartCap() As Drawing2D.LineCap
+        SetStatus(GdipGetPenStartCap(nativePen, StartCap))
+	End Function
+*/
+	Sub EndCap(cap As Drawing2D.LineCap)
+		SetStatus(GdipSetPenEndCap(nativePen, cap))
+	End Sub
+/*
+	Function EndCap() As Drawing2D.LineCap
+        SetStatus(GdipGetPenEndCap(nativePen, EndCap))
+	End Function
+*/
+	Sub DashCap(cap As Drawing2D.DashCap)
+		SetStatus(GdipSetPenDashCap197819(nativePen, cap))
+	End Sub
+/*
+	Function DashCap() As Drawing2D.DashCap
+        SetStatus(GdipGetPenDashCap197819(nativePen, DashCap))
+	End Function
+*/
+	Sub LineJoin(lineJoin As Drawing2D.LineJoin)
+		SetStatus(GdipSetPenLineJoin(nativePen, lineJoin))
+	End Sub
+/*
+	Function LineJoin() As Drawing2D.LineJoin
+        SetStatus(GdipGetPenLineJoin(nativePen, LineJoin))
+	End Function
+*/
+	Sub CustomStartCap(cap As Drawing2D.CustomLineCap)
+		SetStatus(GdipSetPenCustomStartCap(nativePen, getNativeCustomCap(cap)))
+	End Sub
+/*
+	Function CustomStartCap() As Drawing2D.CustomLineCap
+		Dim native As *GpCustomLineCap
+        SetStatus(GdipGetPenCustomStartCap(nativePen, native))
+		CustomStartCap = New Drawing2D.CustomStartCap(native)
+	End Function
+*/
+	Sub CustomEndCap(cap As Drawing2D.CustomLineCap)
+		SetStatus(GdipSetPenCustomEndCap(nativePen, getNativeCustomCap(cap)))
+	End Sub
+/*
+	Function CustomEndCap() As Drawing2D.CustomLineCap
+		Dim nativeCustomCap As *GpCustomLineCap
+        SetStatus(GdipGetPenCustomEndCap(nativePen, nativeCustomCap))
+		CustomStartCap = New CustomStartCap(nativeCustomCap)
+	End Function
+*/
+	Sub MiterLimit(miterLimit As Single)
+		SetStatus(GdipSetPenMiterLimit(nativePen, miterLimit))
+	End Sub
+
+	Function MiterLimit() As Single
+        SetStatus(GdipGetPenMiterLimit(nativePen, MiterLimit))
+	End Function
+
+	Sub Alignment(alignment As Drawing2D.PenAlignment)
+		SetStatus(GdipSetPenMode(nativePen, alignment))
+	End Sub
+/*
+	Function Alignment() As Drawing2D.PenAlignment
+        SetStatus(GdipGetPenMode(nativePen, Alignment))
+	End Function
+*/
+	Sub Transform(m As Drawing2D.Matrix)
+		SetStatus(GdipSetPenTransform(nativePen, m.NativeMatrix))
+	End Sub
+
+	Function Transform() As Drawing2D.Matrix
+		Dim native As *GpMatrix
+        SetStatus(GdipGetPenTransform(nativePen, native))
+		Transform = New Matrix(native)
+	End Function
+/*
+	Function PenType() As Drawing2D.PenType
+		SetStatus(GdipGetPenFillType(nativePen, PenType))
+	End Function
+*/
+	Sub Color(color As Color)
+		SetStatus(GdipSetPenColor(nativePen, color))
+	End Sub
+/*
+	Function Color() As Color
+		If This.PenType <> Drawing2D.PenType.SolidColor Then
+			SetStatus(State.WrongState)
+		End If
+		SetStatus(GdipGetPenColor(nativePen, Color))
+	End Function
+*/
+	Sub Brush(brush As Brush)
+		SetStatus(GdipSetPenBrushFill(nativePen, getNativeBrush(brush)))
+	End Sub
+/*
+	Function Brush() As Brush
+		Imports Drawing2D
+		Dim penType = PenType
+		Dim native As *GpBrush
+		Select Case penType
+			Case PenType.SolidColor
+				SetStatus(GdipGetPenBrushFill(nativePen, native))
+				Brush = New SolidBrush(native)
+			Case PenType.HatchFill
+				SetStatus(GdipGetPenBrushFill(nativePen, native))
+				Brush = New HatchBrush(native)
+			Case PenType.TextureFill
+				SetStatus(GdipGetPenBrushFill(nativePen, native))
+				Brush = New TextureBrush(native)
+			Case PenType.Gradient
+				SetStatus(GdipGetPenBrushFill(nativePen, native))
+				Brush = New Brush(native)
+			Case PenType.LinearGradient
+				SetStatus(GdipGetPenBrushFill(nativePen, native))
+				Brush = New LinearGradientBrush(native)
+			Case Else
+				Brush = Nothing
+		End Select
+	End Function
+*/
+	Sub DashStyle(dashStyle As Drawing2D.DashStyle)
+		SetStatus(GdipSetPenDashStyle(nativePen, dashStyle))
+	End Sub
+/*
+	Function DashStyle() As Drawing2D.DashStyle
+        SetStatus(GdipGetPenDashStyle(nativePen, DashStyle))
+	End Function
+*/
+	Sub DashOffset(dashOffset As Single)
+		SetStatus(GdipSetPenDashOffset(nativePen, dashOffset))
+	End Sub
+
+	Function DashOffset() As Single
+        SetStatus(GdipGetPenDashOffset(nativePen, DashOffset))
+	End Function
+
+	'DashPattern
+	'CompoundArray
+
+	'=========================================================================
+	' Functions
+	'=========================================================================
+
+	Sub SetLineCap(startCap As Drawing2D.LineCap, endCap As Drawing2D.LineCap, dashCap As Drawing2D.DashCap)
+        SetStatus(GdipSetPenLineCap197819(nativePen, startCap, endCap, dashCap))
+	End Sub
+
+	Sub ResetTransform()
+		SetStatus(GdipResetPenTransform(nativePen))
+	End Sub
+
+	Sub MultiplyTransform(m As Drawing2D.Matrix)
+		Imports System.Drawing.Drawing2D
+		MultiplyTransform(m, MatrixOrder.Prepend)
+	End Sub
+
+	Sub MultiplyTransform(m As Drawing2D.Matrix, order As Drawing2D.MatrixOrder)
+		SetStatus(GdipMultiplyPenTransform(nativePen, m.nativeMatrix, order))
+	End Sub
+
+	Sub TranslateTransform(dx As Single, dy As Single)
+		Imports System.Drawing.Drawing2D
+		TranslateTransform(dx, dy, MatrixOrder.Prepend)
+	End Sub
+
+	Sub TranslateTransform(dx As Single, dy As Single, order As Drawing2D.MatrixOrder)
+		SetStatus(GdipTranslatePenTransform(nativePen, dx, dy, order))
+	End Sub
+
+	Sub ScaleTransform(sx As Single, sy As Single)
+		Imports System.Drawing.Drawing2D
+		ScaleTransform(sx, sy, MatrixOrder.Prepend)
+	End Sub
+
+	Sub ScaleTransform(sx As Single, sy As Single, order As Drawing2D.MatrixOrder)
+		SetStatus(GdipScalePenTransform(nativePen, sx, sy, order))
+	End Sub
+
+	Sub RotateTransform(angle As Single)
+		Imports System.Drawing.Drawing2D
+		RotateTransform(angle, MatrixOrder.Prepend)
+	End Sub
+
+	Sub RotateTransform(angle As Single, order As Drawing2D.MatrixOrder)
+		SetStatus(GdipRotatePenTransform(nativePen, angle, order))
+	End Sub
+
+Private
+
+	nativePen As *GpPen
+
+	Static Function getNativeCustomCap(cap As Drawing2D.CustomLineCap) As *GpCustomLineCap
+		If ActiveBasic.IsNothing(cap) Then
+			getNativeCustomCap = 0
+		Else
+			getNativeCustomCap = cap.NativeCap
+		End If
+	End Function
+
+	Static Function getNativeBrush(br As Brush) As *GpBrush
+		If ActiveBasic.IsNothing(br) Then
+			getNativeBrush = 0
+		Else
+			getNativeBrush = br.nativeBrush
+		End If
+	End Function
+
+End Class
+
+End Namespace
+End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Point.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Point.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Point.ab	(revision 698)
@@ -4,123 +4,8 @@
 Namespace Drawing
 
-Class Point
-Public
-	Sub Point()
-		x = 0
-		y = 0
-	End Sub
-
-	Sub Point(initX As Long, initY As Long)
-		x = initX
-		y = initY
-	End Sub
-
-	Sub Point(sz As Size)
-		x = sz.Width
-		y = sz.Height
-	End Sub
-
-	Sub Point(dw As DWord)
-		x = LOWORD(dw)
-		y = HIWORD(dw)
-	End Sub
-
-	Function X() As Long
-		X = x
-	End Function
-
-	Sub X(newX As Long)
-		x = newX
-	End Sub
-
-	Function Y() As Long
-		Y = y
-	End Function
-
-	Sub Y(newY As Long)
-		y = newY
-	End Sub
-
-	Function IsEmpty() As Boolean
-		Return x = 0 And y = 0
-	End Function
-
-	Function Operator +(pt As Point) As Point
-		Return Add(This, pt)
-	End Function
-
-	Function Operator +(sz As Size) As Point
-		Return Add(This, sz)
-	End Function
-
-	Function Operator -(pt As Point) As Point
-		Return Substract(This, pt)
-	End Function
-
-	Function Operator -(sz As Size) As Point
-		Return Substract(This, sz)
-	End Function
-
-	Function Operator ==(sz As Point) As Boolean
-		Return Equals(sz)
-	End Function
-
-	Function Operator <>(sz As Point) As Boolean
-		Return Not Equals(sz)
-	End Function
-
-	Static Function Add(pt1 As Point, pt2 As Point) As Point
-		Return New Point(pt1.x + pt2.x, pt1.y + pt2.y)
-	End Function
-
-	Static Function Add(pt As Point, sz As Size) As Point
-		Return New Point(pt.x + sz.Width, pt.y + sz.Height)
-	End Function
-
-	Function Offset(pt As Point) As Point
-		Return New Point(x + pt.x, y + pt.y)
-	End Function
-
-	Sub Offset(dx As Long, dy As Long)
-		x += dx
-		y += dy
-	End Sub
-
-	Static Function Substract(pt1 As Point, pt2 As Point) As Point
-		Return New Point(pt1.x - pt2.x, pt1.y - pt2.y)
-	End Function
-
-	Static Function Substract(pt As Point, sz As Size) As Point
-		Return New Point(pt.x - sz.Width, pt.y - sz.Height)
-	End Function
-
-	Function Equals(pt As Point) As Boolean
-		Return x = pt.x And y = pt.y
-	End Function
-
-	Override Function GetHashCode() As Long
-		Return x Xor _System_BSwap(y As DWord)
-	End Function
-
-	Static Function Ceiling(ptf As PointF) As Point
-		Return New Point(Math.Ceiling(ptf.X) As Long, Math.Ceiling(ptf.Y) As Long)
-	End Function
-
-	Static Function Round(ptf As PointF) As Point
-		Return New Point(Math.Round(ptf.X) As Long, Math.Round(ptf.Y) As Long)
-	End Function
-
-	Static Function Truncate(ptf As PointF) As Point
-		Return New Point(Math.Truncate(ptf.X) As Long, Math.Truncate(ptf.Y) As Long)
-	End Function
-
-	Function Operator () As PointF
-		Return New PointF(X, Y)
-	End Function
-
-Private
-	x As Long
-	y As Long
-End Class
+Type Point
+	X As Long
+	Y As Long
+End Type
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/PointF.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/PointF.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/PointF.ab	(revision 698)
@@ -4,114 +4,8 @@
 Namespace Drawing
 
-Class PointF
-Public
-	Sub PointF()
-		x = 0
-		y = 0
-	End Sub
-
-	Sub PointF(initX As Single, initY As Single)
-		x = initX
-		y = initY
-	End Sub
-
-	Sub PointF(pt As PointF)
-		x = pt.x
-		y = pt.y
-	End Sub
-
-	Sub PointF(sz As SizeF)
-		x = sz.Width
-		y = sz.Height
-	End Sub
-
-	Function X() As Single
-		X = x
-	End Function
-
-	Sub X(newX As Single)
-		x = newX
-	End Sub
-
-	Function Y() As Single
-		Y = y
-	End Function
-
-	Sub Y(newY As Single)
-		y = newY
-	End Sub
-
-	Function IsEmpty() As Boolean
-		Return x = 0 And y = 0
-	End Function
-
-	Function Operator + (pt As PointF) As PointF
-		Return Add(This, pt)
-	End Function
-
-	Function Operator + (sz As Size) As PointF
-		Return Add(This, sz)
-	End Function
-
-	Function Operator + (sz As SizeF) As PointF
-		Return Add(This, sz)
-	End Function
-
-	Function Operator - (pt As PointF) As PointF
-		Return Substract(This, pt)
-	End Function
-
-	Function Operator - (sz As Size) As PointF
-		Return Substract(This, sz)
-	End Function
-
-	Function Operator - (sz As SizeF) As PointF
-		Return Substract(This, sz)
-	End Function
-
-	Function Operator == (sz As PointF) As Boolean
-		Return Equals(sz)
-	End Function
-
-	Function Operator <> (sz As PointF) As Boolean
-		Return Not Equals(sz)
-	End Function
-
-	Static Function Add(pt1 As PointF, pt2 As PointF) As PointF
-		Return New PointF(pt1.x + pt2.x, pt1.y + pt2.y)
-	End Function
-
-	Static Function Add(pt As PointF, sz As Size) As PointF
-		Return New PointF(pt.x + sz.Width, pt.y + sz.Height)
-	End Function
-
-	Static Function Add(pt As PointF, sz As SizeF) As PointF
-		Return New PointF(pt.x + sz.Width, pt.y + sz.Height)
-	End Function
-
-	Static Function Substract(pt1 As PointF, pt2 As PointF) As PointF
-		Return New PointF(pt1.x - pt2.x, pt1.y - pt2.y)
-	End Function
-
-	Static Function Substract(pt As PointF, sz As Size) As PointF
-		Return New PointF(pt.x - sz.Width, pt.y - sz.Height)
-	End Function
-
-	Static Function Substract(pt As PointF, sz As SizeF) As PointF
-		Return New PointF(pt.x - sz.Width, pt.y - sz.Height)
-	End Function
-
-	Function Equals(pt As PointF) As Boolean
-		Return x = pt.x And y = pt.y
-	End Function
-
-	Override Function GetHashCode() As Long
-		Return (GetDWord(VarPtr(x)) Xor _System_BSwap(GetDWord(VarPtr(x)))) As Long
-	End Function
-
-Private
-	x As Single
-	y As Single
-End Class
+Type PointF
+	X As Single
+	Y As Single
+End Type
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Rectangle.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Rectangle.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Rectangle.ab	(revision 698)
@@ -4,240 +4,10 @@
 Namespace Drawing
 
-Class Rectangle
-Public
-	Sub Rectangle()
-		x = 0
-		y = 0
-		width = 0
-		height = 0
-	End Sub
-
-	Sub Rectangle(x As Long, y As Long, width As Long, height As Long)
-		x = x
-		y = y
-		width = width
-		height = height
-	End Sub
-
-	Sub Rectangle(l As Point, s As Size)
-		x = l.X
-		y = l.Y
-		width = s.Height
-		height = s.Height
-	End Sub
-
-	Sub Rectangle(ByRef r As RECT)
-		x = r.left
-		y = r.top
-		width = r.right - r.left
-		height = r.top - r.bottom
-	End Sub
-
-	Function Location() As Point
-		Location = New Point(x, y)
-	End Function
-
-	Sub Location(point As Point)
-		x = point.X
-		y = point.Y
-	End Sub
-
-	Function Size() As Size
-		Size = New Size(width, height)
-	End Function
-
-	Sub Size(size As Size)
-		width = size.Width
-		height = size.Height
-	End Sub
-
-	Function X() As Long
-		X = x
-	End Function
-
-	Sub X(value As Long)
-		x = value
-	End Sub
-
-	Function Y() As Long
-		Y = y
-	End Function
-
-	Sub Y(value As Long)
-		y = value
-	End Sub
-
-	Function Width() As Long
-		Width = width
-	End Function
-
-	Sub Width(value As Long)
-		width = value
-	End Sub
-
-	Function Height() As Long
-		Height = height
-	End Function
-
-	Sub Height(value As Long)
-		height = value
-	End Sub
-
-	Function Left() As Long
-		Left = X
-	End Function
-
-	Function Top() As Long
-		Top = Y
-	End Function
-
-	Function Right() As Long
-		Right = X + Width
-	End Function
-
-	Function Bottom() As Long
-		Bottom = Y + Height
-	End Function
-
-	Function IsEmpty() As Boolean
-		Return Width <= 0 Or Height <= 0
-	End Function
-
-	Function Operator ==(rc As Rectangle) As Boolean
-		Return Equals(rc)
-	End Function
-
-	Function Operator <>(rc As Rectangle) As Boolean
-		Return (Not Equals(rc))
-	End Function
-
-	Function Operator () As RectangleF
-		Return New RectangleF(x, y, width, height)
-	End Function
-
-	Function Equals(rc As Rectangle) As Boolean
-		Return X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height
-	End Function
-
-	Override Function GetHashCode() As Long
-		Return x As DWord Xor _System_BSwap(y As DWord) Xor width As DWord Xor _System_BSwap(height As DWord)
-	End Function
-
-	Static Function FromLTRB(l As Long, t As Long, r As Long, b As Long) As Rectangle
-		return New Rectangle(l, t, r - l, b - t)
-	End Function
-
-	Function Contains(x As Long, y As Long) As Boolean
-		Return x >= X And x < X + Width And y >= Y And y < Y + Height
-	End Function
-
-	Function Contains(pt As Point) As Boolean
-		Return Contains(pt.X, pt.Y)
-	End Function
-
-	Function Contains(rc As Rectangle) As Boolean
-		Return X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom
-	End Function
-
-	Sub Inflate(dx As Long, dy As Long)
-		x -= dx
-		y -= dy
-		width += dx + dx
-		height += dy + dy
-	End Sub
-
-	Sub Inflate(sz As Size)
-		Inflate(sz.Width, sz.Height)
-	End Sub
-
-	Static Function Inflate(rc As Rectangle, x As Long, y As Long) As Rectangle
-		Inflate = New Rectangle(rc.X, rc.Y, rc.Width, rc.Height)
-		Inflate.Inflate(x, y)
-	End Function
-
-	Sub Intersect(rect As Rectangle)
-		Dim r = Rectangle.Intersect(This, rect)
-		x = r.x
-		y = r.y
-		width = r.width
-		height = r.height
-	End Sub
-
-	Static Function Intersect(a As Rectangle, ByRef b As Rectangle) As Rectangle
-		Dim right As Long, bottom As Long, left As Long, top As Long
-		right = System.Math.Min(a.Right, b.Right)
-		bottom = System.Math.Min(a.Bottom, b.Bottom)
-		left = System.Math.Min(a.Left, b.Left)
-		top = System.Math.Min(a.Top, b.Top)
-		Return Rectangle.FromLTRB(left, top, right, bottom)
-	End Function
-
-	Function IntersectsWith(rc As Rectangle) As Boolean
-		Return Left < rc.Right And _
-			Top < rc.Bottom And _
-			Right > rc.Left And _
-			Bottom > rc.Top
-	End Function
-
-	Static Function Union(a As Rectangle, b As Rectangle) As Rectangle
-		Dim right As Long, bottom As Long, left As Long, top As Long
-		right = System.Math.Max(a.Right(), b.Right())
-		bottom = System.Math.Max(a.Bottom(), b.Bottom())
-		left = System.Math.Max(a.Left(), b.Left())
-		top = System.Math.Max(a.Top(), b.Top())
-		Return FromLTRB(left, top, right, bottom)
-	End Function
-
-	Sub Offset(pt As Point)
-		Offset(pt.X, pt.Y)
-	End Sub
-
-	Sub Offset(dx As Long, dy As Long)
-		x += dx
-		y += dy
-	End Sub
-
-	Static Function Ceiling(rcf As RectangleF) As Rectangle
-		Dim r As Rectangle(
-			Math.Ceiling(rcf.X) As Long,
-			Math.Ceiling(rcf.Y) As Long,
-			Math.Ceiling(rcf.Width) As Long,
-			Math.Ceiling(rcf.Height) As Long)
-		Return r
-	End Function
-
-	Static Function Round(rcf As RectangleF) As Rectangle
-		Dim r As Rectangle(
-			Math.Round(rcf.X) As Long,
-			Math.Round(rcf.Y) As Long,
-			Math.Round(rcf.Width) As Long,
-			Math.Round(rcf.Height) As Long)
-		Return r
-	End Function
-
-	Static Function Truncate(rcf As RectangleF) As Rectangle
-		Dim r As Rectangle(
-			Math.Truncate(rcf.X) As Long,
-			Math.Truncate(rcf.Y) As Long,
-			Math.Truncate(rcf.Width) As Long,
-			Math.Truncate(rcf.Height) As Long)
-		Return r
-	End Function
-
-	Function ToRECT() As RECT
-		With ToRECT
-			.left = x
-			.top = y
-			.right = x + width
-			.bottom = y + height
-		End With
-	End Function
-
-Public
-	x As Long
-	y As Long
-	width As Long
-	height As Long
-End Class
+Type Rectangle
+	X As Long
+	Y As Long
+	Width As Long
+	Height As Long
+End Type
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/RectangleF.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/RectangleF.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/RectangleF.ab	(revision 698)
@@ -4,204 +4,10 @@
 Namespace Drawing
 
-Class RectangleF
-Public
-	Sub RectangleF()
-		x = 0
-		y = 0
-		width = 0
-		height = 0
-	End Sub
-
-	Sub RectangleF(x As Single, y As Single, width As Single, height As Single)
-		x = x
-		y = y
-		width = width
-		height = height
-	End Sub
-
-	Sub RectangleF(location As PointF, size As SizeF)
-		x = location.X
-		y = location.Y
-		width = size.Height
-		height = size.Height
-	End Sub
-
-	Sub RectangleF(rc As RectangleF)
-		x = rc.x
-		y = rc.y
-		width = rc.width
-		height = rc.height
-	End Sub
-
-	Function Location() As PointF
-		Location = New PointF(x, y)
-	End Function
-
-	Sub Location(point As PointF)
-		x = point.X
-		y = point.Y
-	End Sub
-
-	Function Size() As SizeF
-		Size = New SizeF(width, height)
-	End Function
-
-	Sub Size(size As SizeF)
-		width = size.Width
-		height = size.Height
-	End Sub
-
-	Function X() As Single
-		X = x
-	End Function
-
-	Sub X(value As Single)
-		x = value
-	End Sub
-
-	Function Y() As Single
-		Y = y
-	End Function
-
-	Sub Y(value As Single)
-		y = value
-	End Sub
-
-	Function Width() As Single
-		Width = width
-	End Function
-
-	Sub Width(value As Single)
-		width = value
-	End Sub
-
-	Function Height() As Single
-		Height = height
-	End Function
-
-	Sub Height(value As Single)
-		height = value
-	End Sub
-
-	Function Left() As Single
-		Left = X
-	End Function
-
-	Function Top() As Single
-		Top = Y
-	End Function
-
-	Function Right() As Single
-		Right = X + Width
-	End Function
-
-	Function Bottom() As Single
-		Bottom = Y + Height
-	End Function
-
-	Function IsEmpty() As Boolean
-		Return Width <= 0 Or Height <= 0
-	End Function
-
-	Function Operator ==(rc As RectangleF) As Boolean
-		Return Equals(rc)
-	End Function
-
-	Function Operator <>(rc As RectangleF) As Boolean
-		Return Not Equals(rc)
-	End Function
-
-	Function Equals(rc As RectangleF) As Boolean
-		Equals = (X = rc.X And Y = rc.Y And Width = rc.Width And Height = rc.Height)
-	End Function
-
-	Override Function GetHashCode() As Long
-		Return GetDWord(VarPtr(x)) Xor _System_BSwap(GetDWord(VarPtr(y))) Xor GetDWord(VarPtr(width)) Xor _System_BSwap(GetDWord(VarPtr(height)))
-	End Function
-
-	Static Function FromLTRB(l As Single, t As Single, r As Single, b As Single) As RectangleF
-		return New RectangleF(l, t, r - l, b - t)
-	End Function
-
-	Function Contains(x As Single, y As Single) As Boolean
-		Contains = (x >= X And x < X + Width And y >= Y And y < Y + Height)
-	End Function
-
-	Function Contains(pt As PointF) As Boolean
-		Return Contains(pt.X, pt.Y)
-	End Function
-
-	Function Contains(rc As RectangleF) As Boolean
-		Contains = (X <= rc.X And rc.Right <= Right And Y <= rc.Y And rc.Bottom <= Bottom)
-	End Function
-
-	Sub Inflate(dx As Single, dy As Single)
-		x -= dx
-		y -= dy
-		width += dx + dx
-		height += dy + dy
-	End Sub
-
-	Sub Inflate(sz As SizeF)
-		Inflate(sz.Width, sz.Height)
-	End Sub
-
-	Static Function Inflate(rc As RectangleF, x As Single, y As Single) As RectangleF
-		Inflate = New RectangleF(rc.X, rc.Y, rc.Width, rc.Height)
-		Inflate.Inflate(x, y)
-	End Function
-
-	Sub Intersect(rect As RectangleF)
-		Dim r = RectangleF.Intersect(This, rect)
-		x = r.x
-		y = r.y
-		width = r.width
-		height = r.height
-	End Sub
-	
-	Static Function Intersect(a As RectangleF, b As RectangleF) As RectangleF
-		Dim right As Single, bottom As Single, left As Single, top As Single
-		right = System.Math.Min(a.Right, b.Right)
-		bottom = System.Math.Min(a.Bottom, b.Bottom)
-		left = System.Math.Min(a.Left, b.Left)
-		top = System.Math.Min(a.Top, b.Top)
-		Return FromLTRB(left, top, right, bottom)
-	End Function
-
-	Function IntersectsWith(rc As RectangleF) As Boolean
-		If Left < rc.Right And _
-			Top < rc.Bottom And _
-			Right > rc.Left And _
-			Bottom > rc.Top Then
-			IntersectsWith = True
-		Else
-			IntersectsWith = False
-		End If
-	End Function
-
-	Static Function Union(a As RectangleF, b As RectangleF) As RectangleF
-		Dim right As Single, bottom As Single, left As Single, top As Single
-		right = System.Math.Max(a.Right(), b.Right())
-		bottom = System.Math.Max(a.Bottom(), b.Bottom())
-		left = System.Math.Max(a.Left(), b.Left())
-		top = System.Math.Max(a.Top(), b.Top())
-		Return FromLTRB(left, top, right, bottom)
-	End Function
-
-	Sub Offset(pt As PointF)
-		Offset(pt.X, pt.Y)
-	End Sub
-
-	Sub Offset(dx As Single, dy As Single)
-		x += dx
-		y += dy
-	End Sub
-
-Public
-	x As Single
-	y As Single
-	width As Single
-	height As Single
-End Class
+Type RectangleF
+	X As Single
+	Y As Single
+	Width As Single
+	Height As Single
+End Type
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Size.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Size.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Size.ab	(revision 698)
@@ -4,97 +4,8 @@
 Namespace Drawing
 
-Class Size
-Public
-	Sub Size()
-		width = 0
-		height = 0
-	End Sub
-
-	Sub Size(initWidth As Long, initHeight As Long)
-		width = initWidth
-		height = initHeight
-	End Sub
-
-	Sub Size(sz As Size)
-		width = sz.width
-		height = sz.height
-	End Sub
-
-	Function Width() As Long
-		Return width
-	End Function
-
-	Sub Width(w As Long)
-		width = w
-	End Sub
-
-	Function Height() As Long
-		Return height
-	End Function
-
-	Sub Height(h As Long)
-		height = h
-	End Sub
-
-	Function Operator +(sz As Size) As Size
-		Return New Size(width + sz.width, height + sz.height)
-	End Function
-
-	Function Operator -(sz As Size) As Size
-		Return New Size(width - sz.width, height - sz.height)
-	End Function
-
-	Function Operator () As SizeF
-		Return New SizeF(width, height)
-	End Function
-
-	Function Operator ==(sz As Size) As Boolean
-		Return Equals(sz)
-	End Function
-
-	Function Operator <>(sz As Size) As Boolean
-		Return Not Equals(sz)
-	End Function
-
-	Function Equals(sz As Size) As Boolean
-		If width = sz.width And height = sz.height Then
-			Equals = True
-		Else
-			Equals = False
-		End If
-	End Function
-
-	Override Function GetHashCode() As Long
-		Return width As DWord Xor _System_BSwap(height As DWord)
-	End Function
-
-	Function IsEmpty() As Boolean
-		Return width = 0 And height = 0
-	End Function
-
-	Function Add(sz As Size) As Size
-		Return This + sz
-	End Function
-
-	Function Subtract(sz As Size) As Size
-		Return This - sz
-	End Function
-
-	Static Function Ceiling(szf As SizeF) As Size
-		Return New Size(System.Math.Ceiling(szf.Width) As Long, System.Math.Ceiling(szf.Height) As Long)
-	End Function
-
-	Static Function Round(szf As SizeF) As Size
-		Return New Size(System.Math.Round(szf.Width) As Long, System.Math.Round(szf.Height) As Long)
-	End Function
-
-	Static Function Truncate(szf As SizeF) As Size
-		Return New Size(System.Math.Truncate(szf.Width) As Long, System.Math.Truncate(szf.Height) As Long)
-	End Function
-
-Private
-	width As Long
-	height As Long
-End Class
+Type Size
+	Width As Long
+	Height As Long
+End Type
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/SizeF.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/SizeF.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/SizeF.ab	(revision 698)
@@ -4,84 +4,8 @@
 Namespace Drawing
 
-Class SizeF
-Public
-	Sub SizeF()
-		width = 0
-		height = 0
-	End Sub
-
-	Sub SizeF(initWidth As Single, initHeight As Single)
-		width = initWidth
-		height = initHeight
-	End Sub
-
-	Sub SizeF(sz As SizeF)
-		width = sz.width
-		height = sz.height
-	End Sub
-
-	Function Width() As Single
-		Return width
-	End Function
-
-	Sub Width(w As Single)
-		width = w
-	End Sub
-
-	Function Height() As Single
-		Return height
-	End Function
-
-	Sub Height(h As Single)
-		height = h
-	End Sub
-
-	Function Operator +(sz As SizeF) As SizeF
-		Return New SizeF(width + sz.width, height + sz.height)
-	End Function
-
-	Function Operator -(sz As SizeF) As SizeF
-		Return New SizeF(width - sz.width, height - sz.height)
-	End Function
-
-	Function Operator ==(sz As SizeF) As Boolean
-		Return Equals(sz)
-	End Function
-
-	Function Operator <>(sz As SizeF) As Boolean
-		Return Not Equals(sz)
-	End Function
-
-	Function Equals(sz As SizeF) As Boolean
-		Return width = sz.width And height = sz.height
-	End Function
-
-	Override Function GetHashCode() As Long
-		Return GetDWord(VarPtr(width)) Xor _System_BSwap(GetDWord(VarPtr(height)))
-	End Function
-
-	Function IsEmpty() As Boolean
-		Return width = 0 And height = 0
-	End Function
-
-	Function Add(sz As SizeF) As SizeF
-		Return This + sz
-	End Function
-
-	Function Subtract(sz As SizeF) As SizeF
-		Return This - sz
-	End Function
-
-	Function ToSize() As Size
-		Return Size.Round(This)
-	End Function
-
-	Function ToPointF() As PointF
-		Return New PointF(width, height)
-	End Function
-Private
-	width As Single
-	height As Single
-End Class
+Type SizeF
+	Width As Single
+	Height As Single
+End Type
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/misc.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/misc.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/misc.ab	(revision 698)
@@ -37,13 +37,49 @@
 
 Enum FontStyle
-/*
 	Regular = 0
 	Bold = 1
 	Italic = 2
 	Strikeout = 4
-	Underline  = 8
-*/
+	Underline = 8
 End Enum
 
+Enum TextRenderingHint
+	TextRenderingHintSystemDefault = 0
+	TextRenderingHintSingleBitPerPixelGridFit
+	TextRenderingHintSingleBitPerPixel
+	TextRenderingHintAntiAliasGridFit
+	TextRenderingHintAntiAlias
+	TextRenderingHintClearTypeGridFit
+End Enum
+
+Enum MetafileFrameUnit
+	Pixel      = 2
+	Point      = 3
+	Inch       = 4
+	Document   = 5
+	Millimeter = 6
+	Gdi
+End Enum
+
+Namespace Detail
+	Sub ThrowGdiplusException(status As Status)
+		Select Case status
+			Case Ok
+				Exit Sub
+'			Case OutOfMemory
+'				Throw New System.OutOfMemroyException("GDI+")
+			Case NotImplemented
+				Throw New System.NotImplementedException("GDI+")
+'			Case FileNotFoundException
+'				Throw New System.IO.FileNotFoundException("GDI+")
+			Case Else
+				Throw New System.Exception("GDI+")
+		End Select
+	End Sub
+End Namespace
+
+Sub SetStatus(status As Status)
+	Detail.ThrowGdiplusException(status)
+End Sub
 
 End Namespace
Index: trunk/ab5.0/ablib/src/Classes/index.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/index.ab	(revision 695)
+++ trunk/ab5.0/ablib/src/Classes/index.ab	(revision 698)
@@ -47,20 +47,20 @@
 #require "./System/Diagnostics/TraceListener.ab"
 #require "./System/Diagnostics/TraceListenerCollection.ab"
-#require "./System/Drawing/CharacterRange.ab"
-#require "./System/Drawing/Color.ab"
+'#require "./System/Drawing/CharacterRange.ab"
+'#require "./System/Drawing/Color.ab"
 '#require "./System/Drawing/Font.ab"
 '#require "./System/Drawing/Graphics.ab"
 '#require "./System/Drawing/Image.ab"
-#require "./System/Drawing/misc.ab"
-#require "./System/Drawing/Point.ab"
-#require "./System/Drawing/PointF.ab"
-#require "./System/Drawing/Rectangle.ab"
-#require "./System/Drawing/RectangleF.ab"
-#require "./System/Drawing/Size.ab"
-#require "./System/Drawing/SizeF.ab"
+'#require "./System/Drawing/misc.ab"
+'#require "./System/Drawing/Point.ab"
+'#require "./System/Drawing/PointF.ab"
+'#require "./System/Drawing/Rectangle.ab"
+'#require "./System/Drawing/RectangleF.ab"
+'#require "./System/Drawing/Size.ab"
+'#require "./System/Drawing/SizeF.ab"
 '#require "./System/Drawing/Drawing2D/Matrix.ab"
 '#require "./System/Drawing/Drawing2D/misc.ab"
 '#require "./System/Drawing/Imaging/MetafileHeader.ab"
-#require "./System/Drawing/Imaging/misc.ab"
+'#require "./System/Drawing/Imaging/misc.ab"
 '#require "./System/Drawing/Text/misc.ab"
 #require "./System/IO/BinaryReader.ab"
