Hello,
i have a jpg file saved in a isolated storage.
I would a thumbnail (200x200) from this jpeg keep aspect ratio
this is a my code
wb.PixelWidth and wb.PixelHeight is 0!!
thank you
i have a jpg file saved in a isolated storage.
I would a thumbnail (200x200) from this jpeg keep aspect ratio
this is a my code
using (var isolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
WriteableBitmap wb = BitmapFactory.New(0, 0);
wb.FromStream(isolatedStorage.OpenFile("1.jpg", FileMode.Open, FileAccess.Read));
IsolatedStorageFileStream fileStream= isolatedStorage.CreateFile("1_thumb.jpg");
float aspectRatio = (float)wb.PixelWidth / wb.PixelHeight;
wb.SaveJpeg(fileStream, 200, (int) (200 / aspectRatio), 0, 100);
fileStream.Close();
wb = null;
}
it is correct?wb.PixelWidth and wb.PixelHeight is 0!!
thank you