public static void SaveJPEG(ImageHandler objImageHandler, string strFileName) { //Set Output Type ImageCodecInfo objImageCodecInfo; objImageCodecInfo = Tools.GetEncoderInfo("image/jpeg"); //Save objImageHandler.Image.Save(strFileName, objImageCodecInfo, null); }
public static void SaveJPEG(ImageHandler objImageHandler, string strFileName, int intSizePercent) { //Set Output Type ImageCodecInfo objImageCodecInfo; objImageCodecInfo = Tools.GetEncoderInfo("image/jpeg"); Image objNewImage = Tools.Resize(objImageHandler.Image, intSizePercent); //Save objNewImage.Save(strFileName, objImageCodecInfo, null); }
public static ImageHandler GetImage(int intWidth, int intHeight, float fltDPI, Brush objBackgroundColor) { //Create Stage Bitmap objImage = new Bitmap(intWidth, intHeight); objImage.SetResolution(fltDPI, fltDPI); Graphics objStage = System.Drawing.Graphics.FromImage(objImage); //Define Bounds Rectangle objBounds = new Rectangle(0, 0, intWidth, intHeight); //Draw Background Color objStage.FillRectangle(objBackgroundColor, objBounds); //Return ImageHandler ImageHandler objImageHandler = new ImageHandler(); objImageHandler.Image = objImage; objImageHandler.Stage = objStage; objImageHandler.Bounds = objBounds; return objImageHandler; }
public static Image Resize(ImageHandler objImageHandler, int intSizePercent) { Image objNewImage = Tools.Resize(objImageHandler.Image, intSizePercent); return(objNewImage); }