Matrix Transforms: Rotation - Prepend : Matrix « Windows Presentation Foundation « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » Windows Presentation Foundation » Matrix 
16.118.8.Matrix Transforms: Rotation - Prepend
<Window x:Class="WpfApplication1.MatrixTransforms"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Matrix Transforms" Height="450" Width="270">
  <StackPanel>
    <TextBlock Margin="10,10,5,5" Text="Original Matrix:" />
    <TextBlock Name="tbOriginal" Margin="20,0,5,5" />
    <TextBlock Margin="10,0,5,5" Text="Rotation – Prepend:" />
    <TextBlock Name="tbRotatePrepend" Margin="20,0,5,5" TextWrapping="Wrap" />
  </StackPanel>
</Window>

//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Media


Namespace WpfApplication1
  Public Partial Class MatrixTransforms
    Inherits Window
    Public Sub New()
      ' Original matrix: 
      Dim As New Matrix(123401)
      tbOriginal.Text = "(" & m.ToString() ")"

      ' Rotation - Prepend: 
      m = New Matrix(123401)
      m.RotatePrepend(45)
      tbRotatePrepend.Text = "(" & MatrixRound(m).ToString() ")"
    End Sub
    Private Function MatrixRound(As MatrixAs Matrix
      m.M11 = Math.Round(m.M11, 3)
      m.M12 = Math.Round(m.M12, 3)
      m.M21 = Math.Round(m.M21, 3)
      m.M22 = Math.Round(m.M22, 3)
      m.OffsetX = Math.Round(m.OffsetX, 3)
      m.OffsetY = Math.Round(m.OffsetY, 3)
      Return m
    End Function
  End Class
End Namespace
16.118.Matrix
16.118.1.Matrix OperationsMatrix Operations
16.118.2.Matrix Transforms: Scale - PrependMatrix Transforms: Scale - Prepend
16.118.3.Matrix Transforms: ScaleMatrix Transforms: Scale
16.118.4.Matrix Transforms: Rotation atMatrix Transforms: Rotation at
16.118.5.Matrix Transforms: Skew -PrependMatrix Transforms: Skew -Prepend
16.118.6.Matrix Transforms: SkewMatrix Transforms: Skew
16.118.7.Matrix Transforms: Rotation at (x = 1, y = 2) - PrependMatrix Transforms: Rotation at (x = 1, y = 2) - Prepend
16.118.8.Matrix Transforms: Rotation - PrependMatrix Transforms: Rotation - Prepend
16.118.9.Matrix Transforms: RotationMatrix Transforms: Rotation
16.118.10.Matrix Transforms: TranslationMatrix Transforms: Translation
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.