Index: trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/Metafile.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/Metafile.ab	(revision 705)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/Metafile.ab	(revision 705)
@@ -0,0 +1,217 @@
+' Classes/System/Drawing/Imaging/Metafile.ab
+
+Namespace System
+Namespace Drawing
+Namespace Imaging
+
+Class Metafile
+Inherits Image
+Public
+	Sub Metafile(hWmf As HMETAFILE, ByRef wmfPlaceableFileHeader As WmfPlaceableFileHeader, deleteWmf As BOOL)
+		Image(CreateMetafileFromWmf(hWmf, wmfPlaceableFileHeader, deleteWmf) As *GpImage)
+	End Sub
+
+	Sub Metafile(hEmf As HENHMETAFILE, deleteEmf As BOOL)
+		Image(CreateMetafileFromEmf(hEmf, deleteEmf) As *GpImage)
+	End Sub
+
+	Sub Metafile(filename As PCWSTR)
+		Image(CreateMetafileFromFile(filename) As *GpImage)
+	End Sub
+
+	Sub Metafile(filename As String)
+		Image(CreateMetafileFromFile(ToWCStr(filename)) As *GpImage)
+	End Sub
+
+	Sub Metafile(filename As PCWSTR, ByRef wmfPlaceableFileHeader As WmfPlaceableFileHeader)
+		Image(CreateMetafileFromWmfFile(filename, wmfPlaceableFileHeader) As *GpImage)
+	End Sub
+
+	Sub Metafile(filename As String, ByRef wmfPlaceableFileHeader As WmfPlaceableFileHeader)
+		Image(CreateMetafileFromWmfFile(ToWCStr(filename), wmfPlaceableFileHeader) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream)
+		Image(CreateMetafileFromStream(stream) As *GpImage)
+	End Sub
+
+	Sub Metafile(referenceHdc As HDC, emfType As EmfType, description As String)
+		Image(RecordMetafile(referenceHdc, NULL, MetafileFrameUnit.GdiCompatible, emfType, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(referenceHdc As HDC, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafile(referenceHdc, NULL, MetafileFrameUnit.GdiCompatible, emfType, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As String)
+		Image(RecordMetafile(referenceHdc, frameRect, frameUnit, emfType, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafile(referenceHdc, frameRect, frameUnit, emfType, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As String)
+		Image(RecordMetafile(referenceHdc, VarPtr(frameRect), frameUnit, emfType, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafile(referenceHdc, VarPtr(frameRect), frameUnit, emfType, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(fileName As PCWSTR, referenceHdc As HDC, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafileFileName(fileName, referenceHdc, ByVal NULL, MetafileFrameUnit.GdiCompatible, emfType, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(fileName As PCWSTR, referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As String)
+		Image(RecordMetafileFileNameI(fileName, referenceHdc, frameRect, frameUnit, emfType, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(fileName As PCWSTR, referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafileFileNameI(fileName, referenceHdc, frameRect, frameUnit, emfType, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(fileName As PCWSTR, referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As String)
+		Image(RecordMetafileFileName(fileName, referenceHdc, frameRect, frameUnit, emfType, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(fileName As PCWSTR, referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafileFileName(fileName, referenceHdc, frameRect, frameUnit, emfType, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, emfType As EmfType, description As String)
+		Image(RecordMetafileStream(stream, referenceHdc, ByVal NULL, MetafileFrameUnit.GdiCompatible, emfType, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafileStream(stream, referenceHdc, ByVal NULL, MetafileFrameUnit.GdiCompatible, emfType, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, description As String)
+		Image(RecordMetafileStreamI(stream, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, description As PCWSTR)
+		Image(RecordMetafileStreamI(stream, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As String)
+		Image(RecordMetafileStreamI(stream, referenceHdc, frameRect, frameUnit, emfType, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafileStreamI(stream, referenceHdc, frameRect, frameUnit, emfType, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, description As String)
+		Image(RecordMetafileStream(stream, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, description As PCWSTR)
+		Image(RecordMetafileStream(stream, referenceHdc, frameRect, frameUnit, EmfType.EmfPlusDual, description) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As String)
+		Image(RecordMetafileStream(stream, referenceHdc, frameRect, frameUnit, emfType, ToWCStr(description)) As *GpImage)
+	End Sub
+
+	Sub Metafile(stream As IStream, referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR)
+		Image(RecordMetafileStream(stream, referenceHdc, frameRect, frameUnit, emfType, description) As *GpImage)
+	End Sub
+Private
+	Static Function CreateMetafileFromWmf(hWmf As HMETAFILE, ByRef wmfPlaceableFileHeader As WmfPlaceableFileHeader, deleteWmf As BOOL) As *GpMetafile
+		SetStatus(GdipCreateMetafileFromWmf(hWmf, deleteWmf, wmfPlaceableFileHeader, CreateMetafileFromWmf))
+	End Function
+
+	Static Function CreateMetafileFromEmf(hEmf As HENHMETAFILE, deleteEmf As BOOL) As *GpMetafile
+		SetStatus(GdipCreateMetafileFromEmf(hEmf, deleteEmf, CreateMetafileFromEmf))
+	End Function
+
+	Static Function CreateMetafileFromFile(filename As PCWSTR) As *GpMetafile
+		SetStatus(GdipCreateMetafileFromFile(filename, CreateMetafileFromFile))
+	End Function
+
+	Static Function CreateMetafileFromWmfFile(filename As PCWSTR, ByRef wmfPlaceableFileHeader As WmfPlaceableFileHeader) As *GpMetafile
+		SetStatus(GdipCreateMetafileFromWmfFile(filename, wmfPlaceableFileHeader, CreateMetafileFromWmfFile))
+	End Function
+
+	Static Function CreateMetafileFromStream(stream As IStream) As *GpMetafile
+	'	SetStatus(GdipCreateMetafileFromStream(stream, CreateMetafileFromStream))
+		Throw New NotImplementedException
+	End Function
+
+	Static Function RecordMetafile(referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR) As *GpMetafile
+		SetStatus(GdipRecordMetafileI(referenceHdc, emfType, frameRect, frameUnit, description, RecordMetafile))
+	End Function
+
+	' BUG: なぜかframeRectをByRef RectangleFとするとエラーになる。
+	Static Function RecordMetafile(referenceHdc As HDC, frameRect As *RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR) As *GpMetafile
+		SetStatus(GdipRecordMetafile(referenceHdc, emfType, ByVal frameRect, frameUnit, description, RecordMetafile))
+	End Function
+
+	Static Function RecordMetafileFileNameI(fileName As PCWSTR, referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR) As *GpMetafile
+		SetStatus(GdipRecordMetafileFileNameI(fileName, referenceHdc, emfType, frameRect, frameUnit, description, RecordMetafileFileNameI))
+	End Function
+
+	Static Function RecordMetafileFileName(fileName As PCWSTR, referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR) As *GpMetafile
+		SetStatus(GdipRecordMetafileFileName(fileName, referenceHdc, emfType, frameRect, frameUnit, description, RecordMetafileFileName))
+	End Function
+
+	Static Function RecordMetafileStreamI(stream As IStream, referenceHdc As HDC, ByRef frameRect As Rectangle, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR) As *GpMetafile
+	'	SetStatus(GdipRecordMetafileStreamI(stream, referenceHdc, emfType, frameRect, frameUnit, description, RecordMetafileStreamI))
+		Throw New NotImplementedException
+	End Function
+
+	Static Function RecordMetafileStream(stream As IStream, referenceHdc As HDC, ByRef frameRect As RectangleF, frameUnit As MetafileFrameUnit, emfType As EmfType, description As PCWSTR) As *GpMetafile
+	'	SetStatus(GdipRecordMetafileStream(stream, referenceHdc, emfType, frameRect, frameUnit, description, RecordMetafileStream))
+		Throw New NotImplementedException
+	End Function
+
+Public
+	Static Function GetMetafileHeader(hWmf As HMETAFILE, ByRef wmfPlaceableFileHeader As WmfPlaceableFileHeader) As MetafileHeader
+		SetStatus(GdipGetMetafileHeaderFromWmf(hWmf, wmfPlaceableFileHeader, GetMetafileHeader))
+	End Function
+
+	Static Function GetMetafileHeader(hEmf As HENHMETAFILE) As MetafileHeader
+		SetStatus(GdipGetMetafileHeaderFromEmf(hEmf, GetMetafileHeader))
+	End Function
+
+	Static Function GetMetafileHeader(filename As String) As MetafileHeader
+		GetMetafileHeader = GetMetafileHeader(ToWCStr(filename))
+	End Function
+
+	Static Function GetMetafileHeader(filename As PCWSTR) As MetafileHeader
+		SetStatus(GdipGetMetafileHeaderFromFile(filename, GetMetafileHeader))
+	End Function
+
+	Static Function GetMetafileHeader(stream As IO.Stream) As MetafileHeader
+'		GetMetafileHeader = GetMetafileHeader(stream)
+		Throw New NotImplementedException
+	End Function
+
+	Static Function GetMetafileHeader(stream As IStream) As MetafileHeader
+'		SetStatus(GdipGetMetafileHeaderFromStream(NativeMetafile, stream))
+		Throw New NotImplementedException
+	End Function
+
+
+	Function GetMetafileHeader() As MetafileHeader
+		SetStatus(GdipGetMetafileHeaderFromMetafile(NativeMetafile, GetMetafileHeader))
+	End Function
+
+	Function GetHEnhMetafile() As HENHMETAFILE
+		SetStatus(GdipGetHemfFromMetafile(NativeMetafile, GetHEnhMetafile))
+	End Function
+
+	Sub PlayRecord(recordType As EmfPlusRecordType, flags As DWord, dataSize As DWord, data AS *Byte)
+		SetStatus(GdipPlayMetafileRecord(NativeMetafile, recordType, flags, dataSize, data))
+	End Sub
+
+	Function NativeMetafile() As *GpMetafile
+		NativeMetafile = NativeImage As *GpMetafile
+	End Function
+End Class
+
+End Namespace
+End Namespace
+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 703)
+++ trunk/ab5.0/ablib/src/Classes/System/Drawing/Imaging/misc.ab	(revision 705)
@@ -9,6 +9,6 @@
 
 Enum ColorMode
-	ARGB32 = 0
-	ARGB64 = 1
+	Argb32Mode = 0
+	Argb64Mode = 1
 End Enum
 
@@ -64,7 +64,7 @@
 
 Enum PaletteFlags
-	PaletteFlagsHasAlpha    = &h0001
-	PaletteFlagsGrayScale   = &h0002
-	PaletteFlagsHalftone    = &h0004
+	HasAlpha = 1
+	GrayScale = 2
+	Halftone = 4
 End Enum
 
@@ -95,25 +95,25 @@
 
 Enum ColorMatrixFlag
-	Default   = 0
+	Default = 0
 	SkipGrays = 1
-	AltGray   = 2
+	AltGray = 2
 End Enum
 
 Enum ImageCodecFlags
-	Encoder            = &h00000001
-	Decoder            = &h00000002
-	SupportBitmap      = &h00000004
-	SupportVector      = &h00000008
-	SeekableEncode     = &h00000010
-	BlockingDecode     = &h00000020
-
-	Builtin            = &h00010000
-	System             = &h00020000
-	User               = &h00040000
+	Encoder = &h00000001
+	Decoder = &h00000002
+	SupportBitmap = &h00000004
+	SupportVector = &h00000008
+	SeekableEncode = &h00000010
+	BlockingDecode = &h00000020
+
+	Builtin = &h00010000
+	System = &h00020000
+	User = &h00040000
 End Enum
 
 Enum ImageLockMode
-	Read        = &h0001
-	Write       = &h0002
+	Read = &h0001
+	Write = &h0002
 	UserInputBuf= &h0004
 End Enum
@@ -142,269 +142,4 @@
 End Type
 
-Const PropertyTagTypeByte        = 1
-Const PropertyTagTypeASCII       = 2
-Const PropertyTagTypeShort       = 3
-Const PropertyTagTypeLong        = 4
-Const PropertyTagTypeRational    = 5
-Const PropertyTagTypeUndefined   = 7
-Const PropertyTagTypeSLONG       = 9
-Const PropertyTagTypeSRational  = 10
-
-Const PropertyTagExifIFD             = &h8769
-Const PropertyTagGpsIFD              = &h8825
-
-Const PropertyTagNewSubfileType      = &h00FE
-Const PropertyTagSubfileType         = &h00FF
-Const PropertyTagImageWidth          = &h0100
-Const PropertyTagImageHeight         = &h0101
-Const PropertyTagBitsPerSample       = &h0102
-Const PropertyTagCompression         = &h0103
-Const PropertyTagPhotometricInterp   = &h0106
-Const PropertyTagThreshHolding       = &h0107
-Const PropertyTagCellWidth           = &h0108
-Const PropertyTagCellHeight          = &h0109
-Const PropertyTagFillOrder           = &h010A
-Const PropertyTagDocumentName        = &h010D
-Const PropertyTagImageDescription    = &h010E
-Const PropertyTagEquipMake           = &h010F
-Const PropertyTagEquipModel          = &h0110
-Const PropertyTagStripOffsets        = &h0111
-Const PropertyTagOrientation         = &h0112
-Const PropertyTagSamplesPerPixel     = &h0115
-Const PropertyTagRowsPerStrip        = &h0116
-Const PropertyTagStripBytesCount     = &h0117
-Const PropertyTagMinSampleValue      = &h0118
-Const PropertyTagMaxSampleValue      = &h0119
-Const PropertyTagXResolution         = &h011A   ' Image resolution in width direction
-Const PropertyTagYResolution         = &h011B   ' Image resolution in height direction
-Const PropertyTagPlanarConfig        = &h011C   ' Image data arrangement
-Const PropertyTagPageName            = &h011D
-Const PropertyTagXPosition           = &h011E
-Const PropertyTagYPosition           = &h011F
-Const PropertyTagFreeOffset          = &h0120
-Const PropertyTagFreeByteCounts      = &h0121
-Const PropertyTagGrayResponseUnit    = &h0122
-Const PropertyTagGrayResponseCurve   = &h0123
-Const PropertyTagT4Option            = &h0124
-Const PropertyTagT6Option            = &h0125
-Const PropertyTagResolutionUnit      = &h0128   ' Unit of X and Y resolution
-Const PropertyTagPageNumber          = &h0129
-Const PropertyTagTransferFuncition   = &h012D
-Const PropertyTagSoftwareUsed        = &h0131
-Const PropertyTagDateTime            = &h0132
-Const PropertyTagArtist              = &h013B
-Const PropertyTagHostComputer        = &h013C
-Const PropertyTagPredictor           = &h013D
-Const PropertyTagWhitePoint          = &h013E
-Const PropertyTagPrimaryChromaticities = &h013F
-Const PropertyTagColorMap            = &h0140
-Const PropertyTagHalftoneHints       = &h0141
-Const PropertyTagTileWidth           = &h0142
-Const PropertyTagTileLength          = &h0143
-Const PropertyTagTileOffset          = &h0144
-Const PropertyTagTileByteCounts      = &h0145
-Const PropertyTagInkSet              = &h014C
-Const PropertyTagInkNames            = &h014D
-Const PropertyTagNumberOfInks        = &h014E
-Const PropertyTagDotRange            = &h0150
-Const PropertyTagTargetPrinter       = &h0151
-Const PropertyTagExtraSamples        = &h0152
-Const PropertyTagSampleFormat        = &h0153
-Const PropertyTagSMinSampleValue     = &h0154
-Const PropertyTagSMaxSampleValue     = &h0155
-Const PropertyTagTransferRange       = &h0156
-
-Const PropertyTagJPEGProc            = &h0200
-Const PropertyTagJPEGInterFormat     = &h0201
-Const PropertyTagJPEGInterLength     = &h0202
-Const PropertyTagJPEGRestartInterval = &h0203
-Const PropertyTagJPEGLosslessPredictors  = &h0205
-Const PropertyTagJPEGPointTransforms     = &h0206
-Const PropertyTagJPEGQTables         = &h0207
-Const PropertyTagJPEGDCTables        = &h0208
-Const PropertyTagJPEGACTables        = &h0209
-
-Const PropertyTagYCbCrCoefficients   = &h0211
-Const PropertyTagYCbCrSubsampling    = &h0212
-Const PropertyTagYCbCrPositioning    = &h0213
-Const PropertyTagREFBlackWhite       = &h0214
-
-Const PropertyTagICCProfile          = &h8773   ' This TAG is defined by ICC
-                                                ' for embedded ICC in TIFF
-Const PropertyTagGamma               = &h0301
-Const PropertyTagICCProfileDescriptor = &h0302
-Const PropertyTagSRGBRenderingIntent = &h0303
-
-Const PropertyTagImageTitle          = &h0320
-Const PropertyTagCopyright           = &h8298
-
-' Extra TAGs (Like Adobe Image Information tags etc.)
-
-Const PropertyTagResolutionXUnit           = &h5001
-Const PropertyTagResolutionYUnit           = &h5002
-Const PropertyTagResolutionXLengthUnit     = &h5003
-Const PropertyTagResolutionYLengthUnit     = &h5004
-Const PropertyTagPrintFlags                = &h5005
-Const PropertyTagPrintFlagsVersion         = &h5006
-Const PropertyTagPrintFlagsCrop            = &h5007
-Const PropertyTagPrintFlagsBleedWidth      = &h5008
-Const PropertyTagPrintFlagsBleedWidthScale = &h5009
-Const PropertyTagHalftoneLPI               = &h500A
-Const PropertyTagHalftoneLPIUnit           = &h500B
-Const PropertyTagHalftoneDegree            = &h500C
-Const PropertyTagHalftoneShape             = &h500D
-Const PropertyTagHalftoneMisc              = &h500E
-Const PropertyTagHalftoneScreen            = &h500F
-Const PropertyTagJPEGQuality               = &h5010
-Const PropertyTagGridSize                  = &h5011
-Const PropertyTagThumbnailFormat           = &h5012  ' 1 = JPEG, 0 = RAW RGB
-Const PropertyTagThumbnailWidth            = &h5013
-Const PropertyTagThumbnailHeight           = &h5014
-Const PropertyTagThumbnailColorDepth       = &h5015
-Const PropertyTagThumbnailPlanes           = &h5016
-Const PropertyTagThumbnailRawBytes         = &h5017
-Const PropertyTagThumbnailSize             = &h5018
-Const PropertyTagThumbnailCompressedSize   = &h5019
-Const PropertyTagColorTransferFunction     = &h501A
-Const PropertyTagThumbnailData             = &h501B' RAW thumbnail bits in
-                                                   ' JPEG format or RGB format
-                                                   ' depends on
-                                                   ' PropertyTagThumbnailFormat
-
-' Thumbnail related TAGs
-
-Const PropertyTagThumbnailImageWidth       = &h5020  ' Thumbnail width
-Const PropertyTagThumbnailImageHeight      = &h5021  ' Thumbnail height
-Const PropertyTagThumbnailBitsPerSample    = &h5022  ' Number of bits per
-                                                     ' component
-Const PropertyTagThumbnailCompression      = &h5023  ' Compression Scheme
-Const PropertyTagThumbnailPhotometricInterp = &h5024 ' Pixel composition
-Const PropertyTagThumbnailImageDescription = &h5025  ' Image Tile
-Const PropertyTagThumbnailEquipMake        = &h5026  ' Manufacturer of Image
-                                                     ' Input equipment
-Const PropertyTagThumbnailEquipModel       = &h5027  ' Model of Image input
-                                                     ' equipment
-Const PropertyTagThumbnailStripOffsets     = &h5028  ' Image data location
-Const PropertyTagThumbnailOrientation      = &h5029  ' Orientation of image
-Const PropertyTagThumbnailSamplesPerPixel  = &h502A  ' Number of components
-Const PropertyTagThumbnailRowsPerStrip     = &h502B  ' Number of rows per strip
-Const PropertyTagThumbnailStripBytesCount  = &h502C  ' Bytes per compressed
-                                                     ' strip
-Const PropertyTagThumbnailResolutionX      = &h502D  ' Resolution in width
-                                                     ' direction
-Const PropertyTagThumbnailResolutionY      = &h502E  ' Resolution in height
-                                                     ' direction
-Const PropertyTagThumbnailPlanarConfig     = &h502F  ' Image data arrangement
-Const PropertyTagThumbnailResolutionUnit   = &h5030  ' Unit of X and Y
-                                                     ' Resolution
-Const PropertyTagThumbnailTransferFunction = &h5031  ' Transfer function
-Const PropertyTagThumbnailSoftwareUsed     = &h5032  ' Software used
-Const PropertyTagThumbnailDateTime         = &h5033  ' File change date and
-                                                     ' time
-Const PropertyTagThumbnailArtist           = &h5034  ' Person who created the
-                                                     ' image
-Const PropertyTagThumbnailWhitePoint       = &h5035  ' White point chromaticity
-Const PropertyTagThumbnailPrimaryChromaticities = &h5036
-                                                     ' Chromaticities of
-                                                     ' primaries
-Const PropertyTagThumbnailYCbCrCoefficients = &h5037 ' Color space transforma-
-                                                     ' tion coefficients
-Const PropertyTagThumbnailYCbCrSubsampling = &h5038  ' Subsampling ratio of Y
-                                                     ' to C
-Const PropertyTagThumbnailYCbCrPositioning = &h5039  ' Y and C position
-Const PropertyTagThumbnailRefBlackWhite    = &h503A  ' Pair of black and white
-                                                     ' reference values
-Const PropertyTagThumbnailCopyRight        = &h503B  ' CopyRight holder
-
-Const PropertyTagLuminanceTable            = &h5090
-Const PropertyTagChrominanceTable          = &h5091
-
-Const PropertyTagFrameDelay                = &h5100
-Const PropertyTagLoopCount                 = &h5101
-
-Const PropertyTagPixelUnit         = &h5110  ' Unit specifier for pixel/unit
-Const PropertyTagPixelPerUnitX     = &h5111  ' Pixels per unit in X
-Const PropertyTagPixelPerUnitY     = &h5112  ' Pixels per unit in Y
-Const PropertyTagPaletteHistogram  = &h5113  ' Palette histogram
-
-' EXIF specific tag
-
-Const PropertyTagExifExposureTime  = &h829A
-Const PropertyTagExifFNumber       = &h829D
-
-Const PropertyTagExifExposureProg  = &h8822
-Const PropertyTagExifSpectralSense = &h8824
-Const PropertyTagExifISOSpeed      = &h8827
-Const PropertyTagExifOECF          = &h8828
-
-Const PropertyTagExifVer            = &h9000
-Const PropertyTagExifDTOrig         = &h9003 ' Date & time of original
-Const PropertyTagExifDTDigitized    = &h9004 ' Date & time of digital data generation
-
-Const PropertyTagExifCompConfig     = &h9101
-Const PropertyTagExifCompBPP        = &h9102
-
-Const PropertyTagExifShutterSpeed   = &h9201
-Const PropertyTagExifAperture       = &h9202
-Const PropertyTagExifBrightness     = &h9203
-Const PropertyTagExifExposureBias   = &h9204
-Const PropertyTagExifMaxAperture    = &h9205
-Const PropertyTagExifSubjectDist    = &h9206
-Const PropertyTagExifMeteringMode   = &h9207
-Const PropertyTagExifLightSource    = &h9208
-Const PropertyTagExifFlash          = &h9209
-Const PropertyTagExifFocalLength    = &h920A
-Const PropertyTagExifMakerNote      = &h927C
-Const PropertyTagExifUserComment    = &h9286
-Const PropertyTagExifDTSubsec       = &h9290  ' Date & Time subseconds
-Const PropertyTagExifDTOrigSS       = &h9291  ' Date & Time original subseconds
-Const PropertyTagExifDTDigSS        = &h9292  ' Date & TIme digitized subseconds
-
-Const PropertyTagExifFPXVer         = &hA000
-Const PropertyTagExifColorSpace     = &hA001
-Const PropertyTagExifPixXDim        = &hA002
-Const PropertyTagExifPixYDim        = &hA003
-Const PropertyTagExifRelatedWav     = &hA004  ' related sound file
-Const PropertyTagExifInterop        = &hA005
-Const PropertyTagExifFlashEnergy    = &hA20B
-Const PropertyTagExifSpatialFR      = &hA20C  ' Spatial Frequency Response
-Const PropertyTagExifFocalXRes      = &hA20E  ' Focal Plane X Resolution
-Const PropertyTagExifFocalYRes      = &hA20F  ' Focal Plane Y Resolution
-Const PropertyTagExifFocalResUnit   = &hA210  ' Focal Plane Resolution Unit
-Const PropertyTagExifSubjectLoc     = &hA214
-Const PropertyTagExifExposureIndex  = &hA215
-Const PropertyTagExifSensingMethod  = &hA217
-Const PropertyTagExifFileSource     = &hA300
-Const PropertyTagExifSceneType      = &hA301
-Const PropertyTagExifCfaPattern     = &hA302
-
-Const PropertyTagGpsVer             = &h0000
-Const PropertyTagGpsLatitudeRef     = &h0001
-Const PropertyTagGpsLatitude        = &h0002
-Const PropertyTagGpsLongitudeRef    = &h0003
-Const PropertyTagGpsLongitude       = &h0004
-Const PropertyTagGpsAltitudeRef     = &h0005
-Const PropertyTagGpsAltitude        = &h0006
-Const PropertyTagGpsGpsTime         = &h0007
-Const PropertyTagGpsGpsSatellites   = &h0008
-Const PropertyTagGpsGpsStatus       = &h0009
-Const PropertyTagGpsGpsMeasureMode  = &h00A
-Const PropertyTagGpsGpsDop          = &h000B  ' Measurement precision
-Const PropertyTagGpsSpeedRef        = &h000C
-Const PropertyTagGpsSpeed           = &h000D
-Const PropertyTagGpsTrackRef        = &h000E
-Const PropertyTagGpsTrack           = &h000F
-Const PropertyTagGpsImgDirRef       = &h0010
-Const PropertyTagGpsImgDir          = &h0011
-Const PropertyTagGpsMapDatum        = &h0012
-Const PropertyTagGpsDestLatRef      = &h0013
-Const PropertyTagGpsDestLat         = &h0014
-Const PropertyTagGpsDestLongRef     = &h0015
-Const PropertyTagGpsDestLong        = &h0016
-Const PropertyTagGpsDestBearRef     = &h0017
-Const PropertyTagGpsDestBear        = &h0018
-Const PropertyTagGpsDestDistRef     = &h0019
-Const PropertyTagGpsDestDist        = &h001A
-
 Enum ColorChannelFlag
 	ColorChannelC = 0
@@ -425,18 +160,27 @@
 
 Enum EmfType
-	Only     = 4 'MetafileType.Emf As Long
-	PlusOnly = 5 'MetafileType.EmfPlusOnly As Long
-	PlusDual = 6 'MetafileType.EmfPlusDual As Long
+	EmfOnly = 4 'MetafileType.Emf As Long
+	EmfPlusOnly = 5 'MetafileType.EmfPlusOnly As Long
+	EmfPlusDual = 6 'MetafileType.EmfPlusDual As Long
+End Enum
+
+Enum MetafileFrameUnit
+	Pixel = 2
+	Point = 3
+	Inch = 4
+	Document = 5
+	Millimeter = 6
+	GdiCompatible
 End Enum
 
 Enum EncoderParameterValueType
-	Byte           = 1
-	ASCII          = 2
-	Short          = 3
-	Long           = 4
-	Rational       = 5
-	LongRange      = 6
-	Undefined      = 7
-	RationalRange  = 8
+	ValueTypeByte = 1
+	ValueTypeAscii = 2
+	ValueTypeShort = 3
+	ValueTypeLong = 4
+	ValueTypeRational = 5
+	ValueTypeLongRange = 6
+	ValueTypeUndefined = 7
+	ValueTypeRationalRange = 8
 End Enum
 
@@ -746,2 +490,248 @@
 End Namespace
 End Namespace
+
+Namespace Gdiplus
+Const PropertyTagTypeByte        = 1
+Const PropertyTagTypeASCII       = 2
+Const PropertyTagTypeShort       = 3
+Const PropertyTagTypeLong        = 4
+Const PropertyTagTypeRational    = 5
+Const PropertyTagTypeUndefined   = 7
+Const PropertyTagTypeSLONG       = 9
+Const PropertyTagTypeSRational  = 10
+
+Const PropertyTagExifIFD             = &h8769
+Const PropertyTagGpsIFD              = &h8825
+
+Const PropertyTagNewSubfileType      = &h00FE
+Const PropertyTagSubfileType         = &h00FF
+Const PropertyTagImageWidth          = &h0100
+Const PropertyTagImageHeight         = &h0101
+Const PropertyTagBitsPerSample       = &h0102
+Const PropertyTagCompression         = &h0103
+Const PropertyTagPhotometricInterp   = &h0106
+Const PropertyTagThreshHolding       = &h0107
+Const PropertyTagCellWidth           = &h0108
+Const PropertyTagCellHeight          = &h0109
+Const PropertyTagFillOrder           = &h010A
+Const PropertyTagDocumentName        = &h010D
+Const PropertyTagImageDescription    = &h010E
+Const PropertyTagEquipMake           = &h010F
+Const PropertyTagEquipModel          = &h0110
+Const PropertyTagStripOffsets        = &h0111
+Const PropertyTagOrientation         = &h0112
+Const PropertyTagSamplesPerPixel     = &h0115
+Const PropertyTagRowsPerStrip        = &h0116
+Const PropertyTagStripBytesCount     = &h0117
+Const PropertyTagMinSampleValue      = &h0118
+Const PropertyTagMaxSampleValue      = &h0119
+Const PropertyTagXResolution         = &h011A 
+Const PropertyTagYResolution         = &h011B
+Const PropertyTagPlanarConfig        = &h011C
+Const PropertyTagPageName            = &h011D
+Const PropertyTagXPosition           = &h011E
+Const PropertyTagYPosition           = &h011F
+Const PropertyTagFreeOffset          = &h0120
+Const PropertyTagFreeByteCounts      = &h0121
+Const PropertyTagGrayResponseUnit    = &h0122
+Const PropertyTagGrayResponseCurve   = &h0123
+Const PropertyTagT4Option            = &h0124
+Const PropertyTagT6Option            = &h0125
+Const PropertyTagResolutionUnit      = &h0128
+Const PropertyTagPageNumber          = &h0129
+Const PropertyTagTransferFuncition   = &h012D
+Const PropertyTagSoftwareUsed        = &h0131
+Const PropertyTagDateTime            = &h0132
+Const PropertyTagArtist              = &h013B
+Const PropertyTagHostComputer        = &h013C
+Const PropertyTagPredictor           = &h013D
+Const PropertyTagWhitePoint          = &h013E
+Const PropertyTagPrimaryChromaticities = &h013F
+Const PropertyTagColorMap            = &h0140
+Const PropertyTagHalftoneHints       = &h0141
+Const PropertyTagTileWidth           = &h0142
+Const PropertyTagTileLength          = &h0143
+Const PropertyTagTileOffset          = &h0144
+Const PropertyTagTileByteCounts      = &h0145
+Const PropertyTagInkSet              = &h014C
+Const PropertyTagInkNames            = &h014D
+Const PropertyTagNumberOfInks        = &h014E
+Const PropertyTagDotRange            = &h0150
+Const PropertyTagTargetPrinter       = &h0151
+Const PropertyTagExtraSamples        = &h0152
+Const PropertyTagSampleFormat        = &h0153
+Const PropertyTagSMinSampleValue     = &h0154
+Const PropertyTagSMaxSampleValue     = &h0155
+Const PropertyTagTransferRange       = &h0156
+
+Const PropertyTagJPEGProc            = &h0200
+Const PropertyTagJPEGInterFormat     = &h0201
+Const PropertyTagJPEGInterLength     = &h0202
+Const PropertyTagJPEGRestartInterval = &h0203
+Const PropertyTagJPEGLosslessPredictors  = &h0205
+Const PropertyTagJPEGPointTransforms     = &h0206
+Const PropertyTagJPEGQTables         = &h0207
+Const PropertyTagJPEGDCTables        = &h0208
+Const PropertyTagJPEGACTables        = &h0209
+
+Const PropertyTagYCbCrCoefficients   = &h0211
+Const PropertyTagYCbCrSubsampling    = &h0212
+Const PropertyTagYCbCrPositioning    = &h0213
+Const PropertyTagREFBlackWhite       = &h0214
+
+Const PropertyTagICCProfile          = &h8773
+Const PropertyTagGamma               = &h0301
+Const PropertyTagICCProfileDescriptor = &h0302
+Const PropertyTagSRGBRenderingIntent = &h0303
+
+Const PropertyTagImageTitle          = &h0320
+Const PropertyTagCopyright           = &h8298
+
+' Extra TAGs (Like Adobe Image Information tags etc.)
+Const PropertyTagResolutionXUnit           = &h5001
+Const PropertyTagResolutionYUnit           = &h5002
+Const PropertyTagResolutionXLengthUnit     = &h5003
+Const PropertyTagResolutionYLengthUnit     = &h5004
+Const PropertyTagPrintFlags                = &h5005
+Const PropertyTagPrintFlagsVersion         = &h5006
+Const PropertyTagPrintFlagsCrop            = &h5007
+Const PropertyTagPrintFlagsBleedWidth      = &h5008
+Const PropertyTagPrintFlagsBleedWidthScale = &h5009
+Const PropertyTagHalftoneLPI               = &h500A
+Const PropertyTagHalftoneLPIUnit           = &h500B
+Const PropertyTagHalftoneDegree            = &h500C
+Const PropertyTagHalftoneShape             = &h500D
+Const PropertyTagHalftoneMisc              = &h500E
+Const PropertyTagHalftoneScreen            = &h500F
+Const PropertyTagJPEGQuality               = &h5010
+Const PropertyTagGridSize                  = &h5011
+Const PropertyTagThumbnailFormat           = &h5012
+Const PropertyTagThumbnailWidth            = &h5013
+Const PropertyTagThumbnailHeight           = &h5014
+Const PropertyTagThumbnailColorDepth       = &h5015
+Const PropertyTagThumbnailPlanes           = &h5016
+Const PropertyTagThumbnailRawBytes         = &h5017
+Const PropertyTagThumbnailSize             = &h5018
+Const PropertyTagThumbnailCompressedSize   = &h5019
+Const PropertyTagColorTransferFunction     = &h501A
+Const PropertyTagThumbnailData             = &h501B
+
+' Thumbnail related TAGs
+Const PropertyTagThumbnailImageWidth       = &h5020
+Const PropertyTagThumbnailImageHeight      = &h5021 
+Const PropertyTagThumbnailBitsPerSample    = &h5022
+Const PropertyTagThumbnailCompression      = &h5023
+Const PropertyTagThumbnailPhotometricInterp = &h5024
+Const PropertyTagThumbnailImageDescription = &h5025
+Const PropertyTagThumbnailEquipMake        = &h5026
+Const PropertyTagThumbnailEquipModel       = &h5027
+Const PropertyTagThumbnailStripOffsets     = &h5028
+Const PropertyTagThumbnailOrientation      = &h5029
+Const PropertyTagThumbnailSamplesPerPixel  = &h502A
+Const PropertyTagThumbnailRowsPerStrip     = &h502B
+Const PropertyTagThumbnailStripBytesCount  = &h502C
+Const PropertyTagThumbnailResolutionX      = &h502D
+Const PropertyTagThumbnailResolutionY      = &h502E
+Const PropertyTagThumbnailPlanarConfig     = &h502F
+Const PropertyTagThumbnailResolutionUnit   = &h5030
+Const PropertyTagThumbnailTransferFunction = &h5031
+Const PropertyTagThumbnailSoftwareUsed     = &h5032
+Const PropertyTagThumbnailDateTime         = &h5033
+Const PropertyTagThumbnailArtist           = &h5034
+Const PropertyTagThumbnailWhitePoint       = &h5035
+Const PropertyTagThumbnailPrimaryChromaticities = &h5036
+Const PropertyTagThumbnailYCbCrCoefficients = &h5037
+Const PropertyTagThumbnailYCbCrSubsampling = &h5038
+Const PropertyTagThumbnailYCbCrPositioning = &h5039
+Const PropertyTagThumbnailRefBlackWhite    = &h503A
+Const PropertyTagThumbnailCopyRight        = &h503B
+
+Const PropertyTagLuminanceTable            = &h5090
+Const PropertyTagChrominanceTable          = &h5091
+
+Const PropertyTagFrameDelay                = &h5100
+Const PropertyTagLoopCount                 = &h5101
+
+Const PropertyTagPixelUnit         = &h5110
+Const PropertyTagPixelPerUnitX     = &h5111
+Const PropertyTagPixelPerUnitY     = &h5112
+Const PropertyTagPaletteHistogram  = &h5113
+
+' EXIF specific tag
+Const PropertyTagExifExposureTime  = &h829A
+Const PropertyTagExifFNumber       = &h829D
+
+Const PropertyTagExifExposureProg  = &h8822
+Const PropertyTagExifSpectralSense = &h8824
+Const PropertyTagExifISOSpeed      = &h8827
+Const PropertyTagExifOECF          = &h8828
+
+Const PropertyTagExifVer            = &h9000
+Const PropertyTagExifDTOrig         = &h9003
+Const PropertyTagExifDTDigitized    = &h9004
+
+Const PropertyTagExifCompConfig     = &h9101
+Const PropertyTagExifCompBPP        = &h9102
+
+Const PropertyTagExifShutterSpeed   = &h9201
+Const PropertyTagExifAperture       = &h9202
+Const PropertyTagExifBrightness     = &h9203
+Const PropertyTagExifExposureBias   = &h9204
+Const PropertyTagExifMaxAperture    = &h9205
+Const PropertyTagExifSubjectDist    = &h9206
+Const PropertyTagExifMeteringMode   = &h9207
+Const PropertyTagExifLightSource    = &h9208
+Const PropertyTagExifFlash          = &h9209
+Const PropertyTagExifFocalLength    = &h920A
+Const PropertyTagExifMakerNote      = &h927C
+Const PropertyTagExifUserComment    = &h9286
+Const PropertyTagExifDTSubsec       = &h9290
+Const PropertyTagExifDTOrigSS       = &h9291
+Const PropertyTagExifDTDigSS        = &h9292
+
+Const PropertyTagExifFPXVer         = &hA000
+Const PropertyTagExifColorSpace     = &hA001
+Const PropertyTagExifPixXDim        = &hA002
+Const PropertyTagExifPixYDim        = &hA003
+Const PropertyTagExifRelatedWav     = &hA004
+Const PropertyTagExifInterop        = &hA005
+Const PropertyTagExifFlashEnergy    = &hA20B
+Const PropertyTagExifSpatialFR      = &hA20C
+Const PropertyTagExifFocalXRes      = &hA20E
+Const PropertyTagExifFocalYRes      = &hA20F
+Const PropertyTagExifFocalResUnit   = &hA210
+Const PropertyTagExifSubjectLoc     = &hA214
+Const PropertyTagExifExposureIndex  = &hA215
+Const PropertyTagExifSensingMethod  = &hA217
+Const PropertyTagExifFileSource     = &hA300
+Const PropertyTagExifSceneType      = &hA301
+Const PropertyTagExifCfaPattern     = &hA302
+
+Const PropertyTagGpsVer             = &h0000
+Const PropertyTagGpsLatitudeRef     = &h0001
+Const PropertyTagGpsLatitude        = &h0002
+Const PropertyTagGpsLongitudeRef    = &h0003
+Const PropertyTagGpsLongitude       = &h0004
+Const PropertyTagGpsAltitudeRef     = &h0005
+Const PropertyTagGpsAltitude        = &h0006
+Const PropertyTagGpsGpsTime         = &h0007
+Const PropertyTagGpsGpsSatellites   = &h0008
+Const PropertyTagGpsGpsStatus       = &h0009
+Const PropertyTagGpsGpsMeasureMode  = &h000A
+Const PropertyTagGpsGpsDop          = &h000B
+Const PropertyTagGpsSpeedRef        = &h000C
+Const PropertyTagGpsSpeed           = &h000D
+Const PropertyTagGpsTrackRef        = &h000E
+Const PropertyTagGpsTrack           = &h000F
+Const PropertyTagGpsImgDirRef       = &h0010
+Const PropertyTagGpsImgDir          = &h0011
+Const PropertyTagGpsMapDatum        = &h0012
+Const PropertyTagGpsDestLatRef      = &h0013
+Const PropertyTagGpsDestLat         = &h0014
+Const PropertyTagGpsDestLongRef     = &h0015
+Const PropertyTagGpsDestLong        = &h0016
+Const PropertyTagGpsDestBearRef     = &h0017
+Const PropertyTagGpsDestBear        = &h0018
+Const PropertyTagGpsDestDistRef     = &h0019
+Const PropertyTagGpsDestDist        = &h001A
+End Namespace
