Hi guys, I am showing a photo that I took on one of my pages.
I take a photo in portrait mode and it works fine.
When I show a picture in the following image, it processes the photo as it was taken in Landscape.
So I need to rotate the image / image by -90 to fix this.
Here is the relevant code for my .XAML
<Grid x:Name="ContentPanelx" Grid.Row="1" Margin="0,0,0,0">
</Grid>
And here are the methods in which I upload a photo and put it in a ContentPanel.
void loadImage () {// The image will be read from the isolated storage to the next byte array
byte[] data;
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream isfs = isf.OpenFile("0.jpg", FileMode.Open, FileAccess.Read))
{
data = new byte[isfs.Length];
isfs.Read(data, 0, data.Length);
isfs.Close();
}
}
MemoryStream ms = new MemoryStream(data);
BitmapImage bi = new BitmapImage();
bi.SetSource(ms);
Image image = new Image();
image.Height = bi.PixelHeight;
image.Width = bi.PixelWidth;
image.Source = bi;
ContentPanelx.Children.Add(image);
}
}
I think that just rotate on the image after loading. I can do it in iOS, but my C # skills are worse than bad.
Can anyone advise this?
Thanks a lot, -Cake
user440096