TransformedBitmap Class
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
'Declaration Public NotInheritable Class TransformedBitmap Inherits BitmapSource Implements ISupportInitialize 'Usage Dim instance As TransformedBitmap
public final class TransformedBitmap extends BitmapSource implements ISupportInitialize
public final class TransformedBitmap extends BitmapSource implements ISupportInitialize
<TransformedBitmap .../>
TransformedBitmap only supports orthogonal transforms such as rotation transforms of 90 increments and scale transforms. Transforms that skew the image are not supported.
TransformedBitmap implements the ISupportInitialize interface to optimize initialization on multiple properties. Property changes can only occur during object initialization. Call BeginInit to signal that initialization has begun and EndInit to signal that initialization has completed. Once initialized, property changes are ignored.
TransformedBitmap objects created using the TransformedBitmap(BitmapSource,Transform) constructor are automatically initialized and property changes are ignored.
Metadata tags related to image data must be updated if an image is saved to a file after a transform is applied.
This example shows how to rotate an image 90 degrees by using a Rotation property of a BitmapImage.
<Image Width="150" Margin="5" Grid.Column="0" Grid.Row="1"> <Image.Source> <BitmapImage UriSource="/sampleImages/watermelon.jpg" Rotation="Rotate90" /> </Image.Source> </Image>
'Create Image element Dim rotated270 As New Image() rotated270.Width = 150 'Create source Dim bi As New BitmapImage() 'BitmapImage properties must be in a BeginInit/EndInit block bi.BeginInit() bi.UriSource = New Uri("pack://application:,,/sampleImages/watermelon.jpg") 'Set image rotation bi.Rotation = Rotation.Rotate270 bi.EndInit() 'set image source rotated270.Source = bi
More Code
| How to: Chain BitmapSource Objects Together | This example shows how you can apply a variety of effects to an image source by chaining multiple BitmapSource derived objects together. |
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.