/// <summary> /// Gets the image from file. /// </summary> /// <param name="fb0">The FB0.</param> /// <returns></returns> private Image GetImageFromFile(string fb0) { try { Image img = Rgb565.ToImage(fb0); System.IO.File.Delete(fb0); return(img); } catch (Exception ex) { //System.Console.WriteLine ( ex ); return(null); } }
/// <summary> /// Gets the image from raw image. /// </summary> /// <param name="ri">The ri.</param> /// <returns></returns> private Image GetImageFromRawImage(RawImage ri) { try { this.LogDebug("Image Size: {0}", ri.Size.ToString( )); if (ri.Bpp == 16) { return(ri.ToImage(PixelFormat.Format16bppRgb565)); } else if (ri.Bpp == 32) { return(ri.ToImage(PixelFormat.Format32bppArgb)); } else { return(Rgb565.ToImage(ri.Data)); } } catch (Exception ex) { //Console.WriteLine ( ex ); return(null); } }