Graphic2DControl 全プロパティ リファレンス
Graphic2DControl が公開しているすべてのプロパティの一覧です。
描画設定・データ管理・ユーザー操作・表示制御など、用途別に整理しています。
描画オブジェクト
| プロパティ | 型 | 説明 |
Lines | List<Line2D> | 画面に描画される線オブジェクトの一覧。 |
Points | List<Point2D> | 画面に描画される点オブジェクトの一覧。 |
Circles | List<Circle2D> | 画面に描画される円オブジェクトの一覧。 |
Polygons | List<Polygon2D> | 画面に描画される多角形オブジェクトの一覧。 |
Arrows | List<Arrow2D> | 画面に描画される矢印線オブジェクトの一覧。 |
Texts | List<Text2D> | 画面に描画されるテキストオブジェクトの一覧。 |
Arcs | List<Arc2D> | 画面に描画される円弧オブジェクトの一覧。 |
Graphs | List<Graph2D> | 画面に描画されるグラフオブジェクトの一覧。 |
基本的な使い方(オブジェクト追加サンプル)
Graphic2DControl に図形オブジェクトを追加する基本的なサンプルコードです。
各オブジェクトは対応するリストに追加し、最後に Redraw() またはInvalidate()を呼び出します。
// Point
Point2D point = new Point2D();
point.X = -1;
point.Y = -1;
this.graphic2DControl1.Points.Add(point);
// Circle
Circle2D circle = new Circle2D();
circle.X = 3;
circle.Y = 3;
circle.R = 1.0f;
circle.IsFilled = false;
circle.Color = Color.Red;
this.graphic2DControl1.Circles.Add(circle);
// Polygon
Polygon2D polygon2D = new Polygon2D();
polygon2D.IsFilled = true;
polygon2D.Color = Color.Green;
polygon2D.Points.Add(new PointF(-2, 2));
polygon2D.Points.Add(new PointF(-1, 4));
polygon2D.Points.Add(new PointF(0, 2));
this.graphic2DControl1.Polygons.Add(polygon2D);
// Arrow
Arrow2D arrow = new Arrow2D();
arrow.Start = new Point(0, 0);
arrow.End = new Point(3, 3);
arrow.Color = Color.Yellow;
this.graphic2DControl1.Arrows.Add(arrow);
// Text : Welcome
Text2D text = new Text2D();
text.X = -3;
text.Y = -3;
text.FontSize = 16.0f;
text.Text = "ようこそ、3D数学";
text.Angle = 30.0f;
this.graphic2DControl1.Texts.Add(text);
// Text : Angle
Text2D text2 = new Text2D();
text2.X = 0.4f;
text2.Y = 0.4f;
text2.FontSize = 11.0f;
text2.Text = "45°";
text2.Color = Color.Cyan;
this.graphic2DControl1.Texts.Add(text2);
// Text : cosθ
Text2D text3 = new Text2D();
text3.X = 1.5f;
text3.Y = 1.0f;
text3.FontSize = 16.0f;
text3.Text = "cosθ";
this.graphic2DControl1.Texts.Add(text3);
// Arc
Arc2D arc = new Arc2D();
arc.X = 0;
arc.Y = 0;
arc.R = 1.0f;
arc.StartAngle = 0f;
arc.EndAngle = 45.0f;
arc.IsFilled = false;
arc.Color = Color.Cyan;
this.graphic2DControl1.Arcs.Add(arc);
// Graph
Graph2D graph = new Graph2D();
graph.Susiki = "cos(x)";
graph.StartX = -5.0f;
graph.EndX = 5.0f;
graph.Color = Color.White;
graph.CalculateInterval = 0.05f;
graph.CalculateGraphPoints();
this.graphic2DControl1.Graphs.Add(graph);
// Redraw
this.graphic2DControl1.Invalidate();
選択・操作状態
| プロパティ | 型 | 説明 |
SelectedObjects | List<Object2D> | 現在選択されている図形オブジェクトの一覧。 |
表示(グリッド・座標)
| プロパティ | 型 | 説明 |
GridShow | bool | グリッドの表示/非表示を切り替えます。 |
GridTextShow | bool | グリッド座標テキストの表示/非表示を切り替えます。 |
GridWidth | int | グリッド間隔(幅)を指定します。 |
GridColor | Color | グリッド線の色を指定します。 |
XAxisColor | Color | X軸の描画色を指定します。 |
YAxisColor | Color | Y軸の描画色を指定します。 |
TextPosition | eGridTextPosition | グリッド座標テキストの表示位置を指定します。 |
TextOffsetX | int | グリッド座標テキストのX方向オフセット。 |
TextOffsetY | int | グリッド座標テキストのY方向オフセット。 |
ForeColor | Color | グリッド座標テキストなどの描画色。 |
表示倍率・移動
| プロパティ | 型 | 説明 |
UserZoom | float (static) | ユーザー操作による画面拡大率。 |
UserMoveCenterX | int | ユーザー操作による中心座標のX方向移動量。 |
UserMoveCenterY | int | ユーザー操作による中心座標のY方向移動量。 |
情報表示
| プロパティ | 型 | 説明 |
IsShowInfoText | bool | マウス座標やズーム率等の情報をコントロールに表示します。
|
動作モード
| プロパティ | 型 | 説明 |
Mode | eGraphic2DControlMode | コントロールの動作モードを指定します。 |