This project is read-only.

Cropping with mouse movement

Sep 27, 2010 at 9:04 PM


I like the library, it works fine in my Silverlight sample project.

I need to accomplish the following task.

User should be able to draw a rectangle with mouse over the portion of the image on Silverlight page (I guess rectangle can not be larger than initial image).

Then she clicks the button and image gets cropped so only portion in rectangle are left.

Than in code behind writeablebitmap object from the cropped are can be manipulated farther.

I would appreciate if you could post some sample code of how it can be accomplished.


Sep 27, 2010 at 9:12 PM

Your question has not much to do with this library. You're asking how to get the coordinates for cropping. Ask this question rather at the official SL forums

This library gives you the Crop function and more.

Sep 27, 2010 at 9:35 PM

Thanks, will try there.

Sep 28, 2010 at 6:08 PM

Thanks teichgraf again, I was able to prototype cropping with mouse movements.

What I need now is contrast and brightness features. Is there any way to achieve it with your extension library? Can you add those methods to the library?


Sep 28, 2010 at 6:57 PM

Such methods are actually image processing algorithms which should never be part of this library. The WriteableBitmapEx library provides the basics to accomplish this and make things easier.

I give you just one last hint, check my blog and an article I recently wrote. 

- Rene Schulte

Sep 28, 2010 at 8:04 PM

Thank you Rene.