2013/06
-
WPF 2D Scale Transforms.NET/WPF 2D 2013. 6. 28. 00:17
reference : Practical WPF Graphics Programming
-
WPF 2D Object Matrix Transforms.NET/WPF 2D 2013. 6. 28. 00:04
M11 M12 M21 M22 OffsetX OffsetY Apply init Original shape private void BtnApply_Click(object sender, RoutedEventArgs e) { GetValue(); } private void GetValue() { if (matrixTransform != null) { Matrix m = new Matrix(); m.M11 = tbM11 != null ? tbM11.Value : 0; m.M12 = tbM12 != null ? tbM12.Value : 0; m.M21 = tbM21 != null ? tbM21.Value : 0; m.M22 = tbM22 != null ? tbM22.Value : 0; m.OffsetX = tbOf..
-
WPF 2D Creating Perpendicular Lines.NET/WPF 2D 2013. 6. 27. 23:11
X1 Y1 X2 Y2 Length Line2 Apply Close Point1 Point2 Point3 Point4 private Line line1; private Line line2; public MainWindow() { InitializeComponent(); Rectangle rect = new Rectangle(); rect.Stroke = Brushes.Black; rect.Width = canvas1.Width; rect.Height = canvas1.Height; canvas1.Children.Add(rect); line1 = new Line(); line2 = new Line(); AddLines(); } private void AddLines() { Point pt1 = new Poi..
-
WPF 2D Transformations Matrix Transforms.NET/WPF 2D 2013. 6. 27. 22:37
// Invert matrix: Matrix matrix = new Matrix(1, 2, 3, 4, 0, 0); tbOriginal.Text = "(" + matrix.ToString() + ")"; matrix.Invert(); tbInvert.Text = "(" + matrix.ToString() + ")"; // Matrix multiplication: Matrix m1 = new Matrix(1, 2, 3, 4, 0, 1); Matrix m2 = new Matrix(0, 1, 2, 1, 0, 1); Matrix m12 = Matrix.Multiply(m1, m2); Matrix m21 = Matrix.Multiply(m2, m1); tbM1M2.Text = "M1 = (" + m1.ToStrin..
-
WPF 2D 차트에 대한 사용자 정의 좌표.NET/WPF 2D 2013. 6. 18. 23:30
XMin XMax 10 YMin 0 YMax 10 Apply Close public partial class MainWindow : Window { private double xMin = 0.0; private double xMax = 10.0; private double yMin = 0.0; private double yMax = 10.0; private Line line1; private Polyline polyline1; public MainWindow() { InitializeComponent(); AddGraphics(); } private void AddGraphics() { line1 = new Line(); line1.X1 = XNormalize(2.0); line1.Y1 = YNormal..