Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

Convert byte Array or File Storage to Bitmap Image

After I pick file to storage file , How can I convert this file to be ×İn image in order to display it like profile picture?
I converted the file to byte array but don't know what to do next or there is an other way?

Here is my code :

var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
openPicker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary;
StorageFile file = await openPicker.PickSingleFileAsync();

var stream = await file.OpenReadAsync();

using (var dataReader = new DataReader(stream))
      var  bytes = new byte[stream.Size];
      await dataReader.LoadAsync((uint)stream.Size);
      var stream2 = new MemoryStream(bytes);


asked Sep 13, 2013 in Microsoft Window 8 by rajesh
edited Sep 12, 2013
0 votes

Related Hot Questions

Government Jobs Opening