Cut an image every 300 pixel height

1

I'm developing a Clipping report generator where I need to insert captured images from internet pages. Most of the time it is necessary to cut them and distribute them in the PDF pages. How do I crop an image programmatically every 300 pixels in height?

NOTE: This can be in VB or C #.

    
asked by anonymous 20.02.2015 / 14:06

1 answer

2

You can trim the bitmap and then do the conversion.

public Bitmap CropBitmap(Bitmap bitmap, int cropX, int cropY, int cropWidth, int cropHeight){
    Rectangle rect = new Rectangle(cropX, cropY, cropWidth, cropHeight);
    Bitmap cropped = bitmap.Clone(rect, bitmap.PixelFormat);
    return cropped;
}
    
20.02.2015 / 16:09