(VB.NET) Rotate Bitmap in Image WPF XAML -
First of all, I want to clarify that I am German so please do not pay attention to some grammatical mistakes. Image name = "imgdisp";
My problem is that I want to rotate the bitmap which is shown in an image control in WPF using the XAML code grid. Columnps = "4" margin = "10,2,10,10" grid. Rau = "3" grid. Rowspan = "2" & gt; & Lt; Image.Source & gt; & Lt; Transformed bitmap source = "{binding path = current current}" & gt; & Lt; TransformedBitmap.Transform & gt; & Lt; RotateTransform angle = "90" /> & Lt; /TransformedBitmap.Transform> & Lt; / TransformedBitmap & gt; & Lt; /Image.Source> & Lt; / Image & gt;
class property itself looks like this:
public class PropertyClass Implements INotifyPropertyChanged public event PropertyChanged PropertyChangedEventHandler as _ Implements Private Sub INotifyPropertyChanged.PropertyChanged NotifyPropertyChanged (ByVal information string) as RaiseEvent PropertyChanged (I, New PropertyChangedEventArgs (information)) End Sub dim _currentImage string = "" as public property CurrentImage get the Return as string (File.Exists (_currentImage), _currentImage, "" ) Get set up (m) _currentImage as value string) = value CurrentImageName = new FileInfo (value) .Name NotifyPropertyChanged ( "CurrentImage") End Set End Property Private Shared _instance to PropertyClass get as PropertyClass as Shared ReadOnly property provide public _instance some If not, then _instance = new propertyClass is the return _instance, then end and end property and class error I found:
type 'system .Windows.Markup.XamlParseException 'A first opportunity happened in the exception of> PresentationFramework.dll
A Spatial information :. Zeilennummer "97" und Zeilenposition "42" von "B der> Initialisierung von" System.Windows.Media.Imaging.TransformedBitmap ". Wurde Eine Ausnahme> ausgelöst"
What is wrong here? Thank you very much for your help. I'm really worried about this problem.
Why are you applying your turnover to your source? Instead, rotate your image-control.
Here is the XML:
& lt; Image source = "{binding path = current item}" x: name = "imgdisp" grid. Columnps = "4" margin = "10,2,10,10" grid. Rau = "3" grid. Rowspan = "2" & gt; & Lt; Image.RenderTransform & gt; & Lt; RotateTransform angle = "90" /> & Lt; /Image.RenderTransform> & Lt; / Image & gt;