taking images out of sprites


/ Published in: C#
Save to your folder(s)

using System.Drawing;
using System.Drawing.Imaging;


Copy this code and paste it in your HTML
  1. Bitmap img = new Bitmap(@"C:/imageLocation");
  2.  
  3. Rectangle cropArea = new Rectangle(0, 1100, 150, 105);
  4.  
  5.  
  6. Bitmap croppedImage = img.Clone(cropArea, img.PixelFormat);
  7.  
  8.  
  9. pictureBox2.Image = croppedImage;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.