Posts

Showing posts with the label Image cropping C#

Image cropping in C#

public static byte [] CropImage( string Img, int Width, int Height, int X, int Y) {             try             {                 //Generate Image from specified Image file path                 //Img = file path                 System.Drawing.Image OriginalImage = System.Drawing.Image.FromFile(Img);                 //Generate Bitmap with given Width and Height                 Bitmap bmp = new Bitmap(Width, Height);                //Set Resolution of Bitmap  ...