[12] | 1 | ' Classes/System/Drawing/Imaging/MetafileHeader.ab
|
---|
[635] | 2 | Namespace System
|
---|
| 3 | Namespace Drawing
|
---|
| 4 | Namespace Imaging
|
---|
[12] | 5 |
|
---|
| 6 | Type Align(8) ENHMETAHEADER3
|
---|
| 7 | iType As DWord
|
---|
| 8 | nSize As DWord
|
---|
| 9 |
|
---|
| 10 | rclBounds As RECTL
|
---|
| 11 | rclFrame As RECTL
|
---|
| 12 | dSignature As DWord
|
---|
| 13 | nVersion As DWord
|
---|
| 14 | nBytes As DWord
|
---|
| 15 | nRecords As DWord
|
---|
| 16 | nHandles As Word
|
---|
| 17 |
|
---|
| 18 | sReserved As Word
|
---|
| 19 | nDescription As DWord
|
---|
| 20 |
|
---|
| 21 | offDescription As DWord
|
---|
| 22 |
|
---|
| 23 | nPalEntries As DWord
|
---|
| 24 | szlDevice As SIZEL
|
---|
| 25 | szlMillimeters As SIZEL
|
---|
| 26 | End Type
|
---|
| 27 |
|
---|
| 28 | ' Placeable WMFs
|
---|
| 29 |
|
---|
| 30 | Type Align(2) PWMFRect16
|
---|
| 31 | Left As Word
|
---|
| 32 | Top As Word
|
---|
| 33 | Right As Word
|
---|
| 34 | Bottom As Word
|
---|
| 35 | End Type
|
---|
| 36 |
|
---|
| 37 | Type Align(2) WmfPlaceableFileHeader
|
---|
| 38 | Key As DWord
|
---|
| 39 | Hmf As Word
|
---|
| 40 | BoundingBox As PWMFRect16
|
---|
| 41 | Inch As Word
|
---|
| 42 | Reserved As DWord
|
---|
| 43 | Checksum As Word
|
---|
| 44 | End Type
|
---|
| 45 |
|
---|
| 46 | Const GDIP_EMFPLUSFLAGS_DISPLAY = &h00000001
|
---|
| 47 |
|
---|
[698] | 48 | Type MetafileHeader
|
---|
[12] | 49 | mfType As MetafileType
|
---|
| 50 | Size As DWord
|
---|
| 51 | version As DWord
|
---|
| 52 | emfPlusFlags As DWord
|
---|
| 53 | dpiX As Single
|
---|
| 54 | dpiY As Single
|
---|
| 55 | X As Long
|
---|
| 56 | Y As Long
|
---|
| 57 | Width As Long
|
---|
| 58 | Height As Long
|
---|
| 59 | 'Union
|
---|
| 60 | ' WmfHeader As METAHEADER
|
---|
| 61 | EmfHeader As ENHMETAHEADER3
|
---|
| 62 | 'End Union
|
---|
| 63 | emfPlusHeaderSize As Long
|
---|
| 64 | logicalDpiX As Long
|
---|
| 65 | logicalDpiY As Long
|
---|
[698] | 66 | /*
|
---|
[12] | 67 | Public
|
---|
| 68 | Function MetafileType() As MetafileType
|
---|
| 69 | Return mfType
|
---|
| 70 | End Function
|
---|
| 71 |
|
---|
| 72 | Function EmfPlusHeaderSize() As DWord
|
---|
| 73 | Return emfPlusHeaderSize
|
---|
| 74 | End Function
|
---|
| 75 |
|
---|
| 76 | Function Version() As DWord
|
---|
| 77 | Return version
|
---|
| 78 | End Function
|
---|
| 79 |
|
---|
| 80 | Function EmfPlusFlags() As DWord
|
---|
| 81 | Return emfPlusFlags
|
---|
| 82 | End Function
|
---|
| 83 |
|
---|
| 84 | Function DpiX() As Single
|
---|
| 85 | Return dpiX
|
---|
| 86 | End Function
|
---|
| 87 |
|
---|
| 88 | Function DpiY() As Single
|
---|
| 89 | Return dpiY
|
---|
| 90 | End Function
|
---|
| 91 |
|
---|
| 92 | Function Bounds() As Rectangle
|
---|
[698] | 93 | Bounds.X = X
|
---|
| 94 | Bounds.Y = Y
|
---|
| 95 | Bounds.Width = Width
|
---|
| 96 | Bounds.Height = Height
|
---|
[12] | 97 | End Function
|
---|
| 98 |
|
---|
| 99 | Function LogicalDpiX() As Single
|
---|
| 100 | Return logicalDpiX
|
---|
| 101 | End Function
|
---|
| 102 |
|
---|
| 103 | Function LogicalDpiY() As Single
|
---|
| 104 | Return logicalDpiY
|
---|
| 105 | End Function
|
---|
| 106 |
|
---|
| 107 | Function IsWmf() As BOOL
|
---|
| 108 | IsWmf = (mfType = MetafileTypeWmf Or mfType = MetafileTypeWmfPlaceable)
|
---|
| 109 | End Function
|
---|
| 110 |
|
---|
| 111 | Function IsWmfPlaceable() As BOOL
|
---|
| 112 | IsWmfPlaceable = (mfType = MetafileTypeWmfPlaceable)
|
---|
| 113 | End Function
|
---|
| 114 |
|
---|
| 115 | Function IsEmf() As BOOL
|
---|
| 116 | IsEmf = (mfType = MetafileTypeEmf)
|
---|
| 117 | End Function
|
---|
| 118 |
|
---|
| 119 | Function IsEmfOrEmfPlus() As BOOL
|
---|
| 120 | IsEmfOrEmfPlus = (mfType >= MetafileTypeEmf)
|
---|
| 121 | End Function
|
---|
| 122 |
|
---|
| 123 | Function IsEmfPlus() As BOOL
|
---|
| 124 | IsEmfPlus = (mfType >= MetafileTypeEmfPlusOnly)
|
---|
| 125 | End Function
|
---|
| 126 |
|
---|
| 127 | Function IsEmfPlusDual() As BOOL
|
---|
| 128 | IsEmfPlusDual = (mfType = MetafileTypeEmfPlusDual)
|
---|
| 129 | End Function
|
---|
| 130 |
|
---|
[698] | 131 | Function IsEmfPlusOnly() As BOOL
|
---|
[12] | 132 | IsEmfPlusOnly = (mfType = MetafileTypeEmfPlusOnly)
|
---|
| 133 | End Function
|
---|
| 134 |
|
---|
| 135 | Function IsDisplay() As BOOL
|
---|
| 136 | If IsEmfPlus() <> FALSE And ((EmfPlusFlags And GDIP_EMFPLUSFLAGS_DISPLAY) <> 0) Then
|
---|
[698] | 137 | IsDisplay = TRUE
|
---|
[12] | 138 | Else
|
---|
[698] | 139 | IsDisplay = FALSE
|
---|
| 140 | End If
|
---|
[12] | 141 | End Function
|
---|
| 142 |
|
---|
| 143 | Function WmfHeader() As *METAHEADER 'const METAHEADER* const
|
---|
| 144 | If IsWmf() Then
|
---|
| 145 | Return VarPtr(EmfHeader) 'VarPtr(WmfHeader)
|
---|
| 146 | Else
|
---|
| 147 | Return 0
|
---|
| 148 | End If
|
---|
| 149 | End Function
|
---|
| 150 |
|
---|
[698] | 151 | Function GetEmfHeader() As *ENHMETAHEADER3
|
---|
[12] | 152 | If IsEmfOrEmfPlus() Then
|
---|
| 153 | Return VarPtr(EmfHeader) 'VarPtr(WmfHeader)
|
---|
| 154 | Else
|
---|
| 155 | Return 0
|
---|
| 156 | End If
|
---|
| 157 | End Function
|
---|
[698] | 158 | */
|
---|
| 159 | End Type
|
---|
[635] | 160 |
|
---|
| 161 | End Namespace
|
---|
| 162 | End Namespace
|
---|
| 163 | End Namespace
|
---|