What's the best way to crop an image?

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?
 
T

Tim Roberts

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top