ホーム › Graphics.Direct2D › ID2D1Geometry
ID2D1Geometry
COM公式ドキュメント
ジオメトリリソースを表し、幾何学的な図形を操作および測定するための一連のヘルパーメソッドを定義します。ID2D1Geometry を継承するインターフェイスは、特定の図形を定義します。
解説(Remarks)
Direct2D のジオメトリオブジェクトにはいくつかの種類があります。単純なジオメトリ(ID2D1RectangleGeometry、ID2D1RoundedRectangleGeometry、または ID2D1EllipseGeometry)、パスジオメトリ(ID2D1PathGeometry)、または複合ジオメトリ(ID2D1GeometryGroup および ID2D1TransformedGeometry)です。
Direct2D のジオメトリを使用すると、2 次元の図形を記述できるほか、ヒットテスト領域、クリップ領域、さらにはアニメーションのパスの定義など、さまざまな用途に利用できます。
Direct2D のジオメトリは、ID2D1Factory によって作成される、変更不可能でデバイスに依存しないリソースです。一般に、ジオメトリは一度作成したら、アプリケーションの存続期間中、または変更が必要になるまで保持しておくべきです。デバイスに依存するリソースおよびデバイスに依存しないリソースの詳細については、リソースの概要を参照してください。
メソッド 13
vtbl = vtable インデックス(0始まり)。HSP等からCOMメソッドをインデックス指定で呼ぶ際に使用します。0〜2 は IUnknown。
vtbl 4 HRESULT GetBounds(D2D_MATRIX_3X2_F* worldTransform, D2D_RECT_F* bounds)
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| bounds | D2D_RECT_F* | out | 変換後ジオメトリの境界矩形を受け取る出力ポインタ。 |
vtbl 5 HRESULT GetWidenedBounds(FLOAT strokeWidth, ID2D1StrokeStyle* strokeStyle, D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, D2D_RECT_F* bounds)
| strokeWidth | FLOAT | in | ストロークの線幅。境界算出に反映するデバイス非依存ピクセル単位の浮動小数。 |
| strokeStyle | ID2D1StrokeStyle* | inoptional | ストロークのスタイル。NULL可で既定の実線スタイルを用いる。 |
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| bounds | D2D_RECT_F* | out | 拡幅後ジオメトリの境界矩形を受け取る出力ポインタ。 |
vtbl 6 HRESULT StrokeContainsPoint(D2D_POINT_2F point, FLOAT strokeWidth, ID2D1StrokeStyle* strokeStyle, D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, BOOL* contains)
| point | D2D_POINT_2F | in | 包含判定を行う対象点。ジオメトリ空間での2次元座標で指定する。 |
| strokeWidth | FLOAT | in | ストロークの線幅。判定対象の輪郭幅を表す浮動小数。 |
| strokeStyle | ID2D1StrokeStyle* | inoptional | ストロークのスタイル。NULL可で既定の実線スタイルを用いる。 |
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| contains | BOOL* | out | 点がストローク内に含まれるか否かを受け取るBOOL出力ポインタ。 |
vtbl 7 HRESULT FillContainsPoint(D2D_POINT_2F point, D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, BOOL* contains)
| point | D2D_POINT_2F | in | 包含判定を行う対象点。ジオメトリ空間での2次元座標で指定する。 |
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| contains | BOOL* | out | 点が塗りつぶし領域内に含まれるか否かを受け取るBOOL出力ポインタ。 |
vtbl 8 HRESULT CompareWithGeometry(ID2D1Geometry* inputGeometry, D2D_MATRIX_3X2_F* inputGeometryTransform, FLOAT flatteningTolerance, D2D1_GEOMETRY_RELATION* relation)
| inputGeometry | ID2D1Geometry* | in | 比較対象となる別のジオメトリへのポインタ。 |
| inputGeometryTransform | D2D_MATRIX_3X2_F* | inoptional | 比較対象ジオメトリに適用する変換行列。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| relation | D2D1_GEOMETRY_RELATION* | out | 2つのジオメトリの位置関係(包含・交差・分離等)を受け取る出力ポインタ。 |
vtbl 9 HRESULT Simplify(D2D1_GEOMETRY_SIMPLIFICATION_OPTION simplificationOption, D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, ID2D1SimplifiedGeometrySink* geometrySink)
| simplificationOption | D2D1_GEOMETRY_SIMPLIFICATION_OPTION | in | 簡略化方法を指定する列挙値。線分のみか曲線を保持するかを選ぶ。 |
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| geometrySink | ID2D1SimplifiedGeometrySink* | in | 簡略化結果を書き込む出力先のジオメトリシンク。 |
vtbl 10 HRESULT Tessellate(D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, ID2D1TessellationSink* tessellationSink)
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| tessellationSink | ID2D1TessellationSink* | in | 三角形分割結果を受け取る出力先のテッセレーションシンク。 |
vtbl 11 HRESULT CombineWithGeometry(ID2D1Geometry* inputGeometry, D2D1_COMBINE_MODE combineMode, D2D_MATRIX_3X2_F* inputGeometryTransform, FLOAT flatteningTolerance, ID2D1SimplifiedGeometrySink* geometrySink)
| inputGeometry | ID2D1Geometry* | in | 結合対象となる別のジオメトリへのポインタ。 |
| combineMode | D2D1_COMBINE_MODE | in | 結合方法を指定する列挙値。和・交差・排他・差分から選ぶ。 |
| inputGeometryTransform | D2D_MATRIX_3X2_F* | inoptional | 結合対象ジオメトリに適用する変換行列。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| geometrySink | ID2D1SimplifiedGeometrySink* | in | 結合結果を書き込む出力先のジオメトリシンク。 |
vtbl 12 HRESULT Outline(D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, ID2D1SimplifiedGeometrySink* geometrySink)
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| geometrySink | ID2D1SimplifiedGeometrySink* | in | 自己交差を解消した輪郭を書き込む出力先のジオメトリシンク。 |
vtbl 13 HRESULT ComputeArea(D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, FLOAT* area)
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| area | FLOAT* | out | 算出した面積を受け取るFLOAT出力ポインタ。 |
vtbl 14 HRESULT ComputeLength(D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, FLOAT* length)
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| length | FLOAT* | out | 算出した周囲長を受け取るFLOAT出力ポインタ。 |
vtbl 15 HRESULT ComputePointAtLength(FLOAT length, D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, D2D_POINT_2F* point, D2D_POINT_2F* unitTangentVector)
| length | FLOAT | in | ジオメトリ始点からの距離。この位置の点を求める浮動小数。 |
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| point | D2D_POINT_2F* | outoptional | 指定距離位置の座標を受け取る出力ポインタ。NULL可。 |
| unitTangentVector | D2D_POINT_2F* | outoptional | 指定距離位置の単位接線ベクトルを受け取る出力ポインタ。NULL可。 |
vtbl 16 HRESULT Widen(FLOAT strokeWidth, ID2D1StrokeStyle* strokeStyle, D2D_MATRIX_3X2_F* worldTransform, FLOAT flatteningTolerance, ID2D1SimplifiedGeometrySink* geometrySink)
| strokeWidth | FLOAT | in | 拡幅するストロークの線幅。デバイス非依存ピクセル単位の浮動小数。 |
| strokeStyle | ID2D1StrokeStyle* | inoptional | ストロークのスタイル。NULL可で既定の実線スタイルを用いる。 |
| worldTransform | D2D_MATRIX_3X2_F* | inoptional | ジオメトリに適用する変換行列へのポインタ。NULL可で恒等変換を意味する。 |
| flatteningTolerance | FLOAT | in | 曲線を直線近似する際の許容誤差。小さいほど高精度になる浮動小数。 |
| geometrySink | ID2D1SimplifiedGeometrySink* | in | 拡幅後のジオメトリを書き込む出力先のジオメトリシンク。 |
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"。
出力引数:
#define global IID_ID2D1Geometry "{2CD906A1-12E2-11DC-9FED-001143A055F9}" #usecom global ID2D1Geometry IID_ID2D1Geometry "{}" #comfunc global ID2D1Geometry_GetBounds 4 var,var #comfunc global ID2D1Geometry_GetWidenedBounds 5 float,sptr,var,float,var #comfunc global ID2D1Geometry_StrokeContainsPoint 6 int,float,sptr,var,float,var #comfunc global ID2D1Geometry_FillContainsPoint 7 int,var,float,var #comfunc global ID2D1Geometry_CompareWithGeometry 8 sptr,var,float,var #comfunc global ID2D1Geometry_Simplify 9 int,var,float,sptr #comfunc global ID2D1Geometry_Tessellate 10 var,float,sptr #comfunc global ID2D1Geometry_CombineWithGeometry 11 sptr,int,var,float,sptr #comfunc global ID2D1Geometry_Outline 12 var,float,sptr #comfunc global ID2D1Geometry_ComputeArea 13 var,float,var #comfunc global ID2D1Geometry_ComputeLength 14 var,float,var #comfunc global ID2D1Geometry_ComputePointAtLength 15 float,var,float,var,var #comfunc global ID2D1Geometry_Widen 16 float,sptr,var,float,sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。#define global IID_ID2D1Geometry "{2CD906A1-12E2-11DC-9FED-001143A055F9}" #usecom global ID2D1Geometry IID_ID2D1Geometry "{}" #comfunc global ID2D1Geometry_GetBounds 4 sptr,sptr #comfunc global ID2D1Geometry_GetWidenedBounds 5 float,sptr,sptr,float,sptr #comfunc global ID2D1Geometry_StrokeContainsPoint 6 int,float,sptr,sptr,float,sptr #comfunc global ID2D1Geometry_FillContainsPoint 7 int,sptr,float,sptr #comfunc global ID2D1Geometry_CompareWithGeometry 8 sptr,sptr,float,sptr #comfunc global ID2D1Geometry_Simplify 9 int,sptr,float,sptr #comfunc global ID2D1Geometry_Tessellate 10 sptr,float,sptr #comfunc global ID2D1Geometry_CombineWithGeometry 11 sptr,int,sptr,float,sptr #comfunc global ID2D1Geometry_Outline 12 sptr,float,sptr #comfunc global ID2D1Geometry_ComputeArea 13 sptr,float,sptr #comfunc global ID2D1Geometry_ComputeLength 14 sptr,float,sptr #comfunc global ID2D1Geometry_ComputePointAtLength 15 float,sptr,float,sptr,sptr #comfunc global ID2D1Geometry_Widen 16 float,sptr,sptr,float,sptr ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。