C# crop an image at small top portion -


I have an image and I want to crop the top part of the image and save the image in C #. How can I go about it?

Here's some well-documented:

  try {/ / Create Destination (crop) bitmap bitmap bmpCropped = new bitmap (100, 100); // Create Graphics Objects to Draw with GraphicsG = Graphics.Frem Image (BMP Cropped); Rectangle rectDestination = new rectangle (0, 0, BMP Croped Wideth, BMP Crop. Height); Rectangle rectCropArea = new rectangle (myX, myY, myCropWidth, myCropHyight); // drag rectCropArea of ​​the original image to the rectDestination of bmpCropped g.DrawImage (myOriginalImage, rectDestination, rectCropArea, GraphicsUnit.Pixel); // release system resources} {g.Dispose (); }  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -