/// <summary> /// Get the bitmap image from the map data. /// </summary> /// <param name="mapData">The byte array containing the image.</param> /// <returns>The new bitmap image.</returns> public static Bitmap GetBitmap(byte[] mapData) { Bitmap bitmap = null; Nequeo.Drawing.Image image = new Nequeo.Drawing.Image(); // Load the data into the image. using (System.IO.MemoryStream stream = new System.IO.MemoryStream(mapData)) { // Get the image. bitmap = image.Create(stream); } // Return the image. return(bitmap); }
/// <summary> /// Save the bitmap image. /// </summary> /// <param name="bitmap">The bitmap image to save.</param> /// <param name="stream">The stream to write the image to.</param> /// <param name="imageFormat">The image format to create.</param> public static void SaveBitmap(Bitmap bitmap, System.IO.Stream stream, System.Drawing.Imaging.ImageFormat imageFormat) { Nequeo.Drawing.Image image = new Nequeo.Drawing.Image(); image.Save(bitmap, stream, imageFormat); }