Esempio n. 1
0
 /// <summary>
 /// This calculates the width and height of the bitmap image
 /// and sets the Stream and the pixels byte array
 /// </summary>
 /// <param name="stream"> The stream where the pixels data will be written </param>
 /// <param name="bitmap"> The image from where the data will be taken </param>
 /// <param name="givenImage"> The RemedyImage where the bitmap will be displayed</param>
 public void prepareImage(Stream stream, WriteableBitmap bitmap, RemedyImage givenImage)
 {
     givenImage.width = (int)bitmap.PixelWidth;
     givenImage.height = (int)bitmap.PixelHeight;
     stream = bitmap.PixelBuffer.AsStream();
     givenImage.dstPixels = new byte[4 * bitmap.PixelWidth * bitmap.PixelHeight];
     givenImage.Reset();
 }