WPF VB.Net Tutorial

  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="ImageElementExample.TransformedImageExample"
    Title="Transformed Image Example"
    Loaded="PageLoaded">
   
      
   

   
      
      
         
           
             
               
                 
               

             
           

         
      
   


//File:Window.xaml.vb
Imports System
Imports System.Windows
Imports System.Windows.Documents
Imports System.Windows.Controls
Imports System.Windows.Navigation
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Namespace ImageElementExample
  Public Partial Class TransformedImageExample
    Inherits Page
    Public Sub New()
    End Sub
    Public Sub PageLoaded(sender As Object, args As RoutedEventArgs)
      Dim rotated90 As New Image()
      rotated90.Width = 150
      Dim tb As New TransformedBitmap()
      Dim bi As New BitmapImage()
      bi.BeginInit()
      bi.UriSource = New Uri("file:///c:/image.jpg", UriKind.RelativeOrAbsolute)
      bi.EndInit()
      tb.BeginInit()
      tb.Source = bi
      Dim transform As New RotateTransform(90)
      tb.Transform = transform
      tb.EndInit()
      rotated90.Source = tb
      Grid.SetColumn(rotated90, 1)
      Grid.SetRow(rotated90, 1)
      transformedGrid.Children.Add(rotated90)
    End Sub
  End Class
End Namespace