What's the best way to crop an image?

  • Thread starter Thread starter trant
  • Start date Start date
T

trant

I currently use the following method to crop an image:

Image img; // my source image

// render image

Bitmap crop = img.Clone(cropArea, img.PixelFormat);

But I wonder if this is inefficient or problematic.

Is there a better way? Something with better performance?
 
trant said:
I currently use the following method to crop an image:

Image img; // my source image

// render image

Bitmap crop = img.Clone(cropArea, img.PixelFormat);

But I wonder if this is inefficient or problematic.

Why do you "wonder"? If you haven't measured the performance, then you
shouldn't be optimizing already. First, make it WORK. Then, figure out
whether it is fast enough. If it's NOT fast enough, then figure out where
the time is being spent.
 
Back
Top