GraphicsPathIterator.HasCurve メソッド
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As GraphicsPathIterator Dim returnValue As Boolean returnValue = instance.HasCurve
このメソッドは、現在のサブパスに曲線が含まれている場合は true を返します。それ以外の場合は false を返します。

パス内のすべての曲線は、ベジエ スプラインのシーケンスとして格納されています。たとえば、パスに楕円を追加する場合は、その楕円に外接する四角形の左上隅の位置、幅、および高さを指定します。しかし、これらの数値 (左上隅の位置、幅、および高さ) がパスに格納されるわけではなく、楕円そのものが、4 本のベジエ スプラインのシーケンスに変換されます。パスには、これらのベジエ スプラインのエンドポイントと制御点が格納されます。
パスにはデータ点の配列が格納され、それぞれの点は直線またはベジエ スプラインに属しています。配列内のいくつかの点がベジエ スプラインに属している場合、HasCurve は true を返します。配列内のすべての点が直線に属している場合は、HasCurve は false を返します。
メソッドの中には、パスを平坦にする、つまり、パス内のすべての曲線を連続した複数の直線に変換するメソッドもあります。パスが平坦にされた後で HasCurve を呼び出した場合は、必ず false が返されます。GraphicsPath クラスの Flatten、Widen、または Warp の各メソッドを呼び出すと、パスが平坦になります。

次の例は、Windows フォームでの使用を意図してデザインされており、OnPaint イベントのオブジェクトである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public Sub HasCurveExample(ByVal e As PaintEventArgs) Dim myPath As New GraphicsPath Dim myPoints As Point() = {New Point(20, 20), _ New Point(120, 120), New Point(20, 120), New Point(20, 20)} Dim myRect As New Rectangle(120, 120, 100, 100) myPath.AddLines(myPoints) myPath.AddRectangle(myRect) myPath.AddEllipse(220, 220, 100, 100) ' Create a GraphicsPathIterator for myPath. Dim myPathIterator As New GraphicsPathIterator(myPath) Dim myHasCurve As Boolean = myPathIterator.HasCurve() MessageBox.Show(myHasCurve.ToString()) End Sub
private void HasCurveExample(PaintEventArgs e) { // Create a path and add three lines, // a rectangle and an ellipse. GraphicsPath myPath = new GraphicsPath(); Point[] myPoints = {new Point(20, 20), new Point(120, 120), new Point(20, 120),new Point(20, 20) }; Rectangle myRect = new Rectangle(120, 120, 100, 100); myPath.AddLines(myPoints); myPath.AddRectangle(myRect); myPath.AddEllipse(220, 220, 100, 100); // Create a GraphicsPathIterator for myPath. GraphicsPathIterator myPathIterator = new GraphicsPathIterator(myPath); // Test for a curve. bool myHasCurve = myPathIterator.HasCurve(); // Show the test result. MessageBox.Show(myHasCurve.ToString()); }
private: void HasCurveExample( PaintEventArgs^ /*e*/ ) { // Create a path and add three lines, // a rectangle and an ellipse. GraphicsPath^ myPath = gcnew GraphicsPath; array<Point>^ myPoints = {Point(20,20),Point(120,120),Point(20,120),Point(20 ,20)}; Rectangle myRect = Rectangle(120,120,100,100); myPath->AddLines( myPoints ); myPath->AddRectangle( myRect ); myPath->AddEllipse( 220, 220, 100, 100 ); // Create a GraphicsPathIterator for myPath. GraphicsPathIterator^ myPathIterator = gcnew GraphicsPathIterator( myPath ); // Test for a curve. bool myHasCurve = myPathIterator->HasCurve(); // Show the test result. MessageBox::Show( myHasCurve.ToString() ); }
private void HasCurveExample(PaintEventArgs e) { // Create a path and add three lines, // a rectangle and an ellipse. GraphicsPath myPath = new GraphicsPath(); Point myPoints[] = { new Point(20, 20), new Point(120, 120), new Point(20, 120), new Point(20, 20) }; Rectangle myRect = new Rectangle(120, 120, 100, 100); myPath.AddLines(myPoints); myPath.AddRectangle(myRect); myPath.AddEllipse(220, 220, 100, 100); // Create a GraphicsPathIterator for myPath. GraphicsPathIterator myPathIterator = new GraphicsPathIterator(myPath); // Test for a curve. boolean myHasCurve = myPathIterator.HasCurve(); // Show the test result. MessageBox.Show(System.Convert.ToString(myHasCurve)); } //HasCurveExample

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からGraphicsPathIterator.HasCurve メソッドを検索する場合は、下記のリンクをクリックしてください。

- GraphicsPathIterator.HasCurve メソッドのページへのリンク