public static Bitmap OpenImage(this TextStructure filePath) { try { using (var bitmap = new Bitmap(filePath.Value)) { return(Image.Clone(bitmap, PixelFormat.Format24bppRgb)); } } catch (Exception ex) { throw new Exception($"Could not open the image file '{filePath.Value}'. Message: {ex.Message}", ex); } }
private static readonly double _pokemonCardRatio = 63.0 / 88; // Width / Height public static Bitmap Format(Bitmap bitmap) { return(Image.Clone(bitmap, PixelFormat.Format24bppRgb)); }