본문 바로가기

.NET/WPF 2D

WPF 2D SkewTransform reference : Practical WPF Graphics Programming 더보기
WPF 2D RotateTransform reference : Practical WPF Graphics Programming 더보기
WPF 2D TranslateTransform reference : Practical WPF Graphics Programming 더보기
WPF 2D Scale Transforms reference : Practical WPF Graphics Programming 더보기
WPF 2D Object Matrix Transforms 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 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 // 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 Basic 2D Graphics Shapes public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); for (int i = 0; i 더보기