问题
I am new to Silverlight 5. I am developing a Silverlight application to capture an image through a webcam and assign that image to an image control.
Now after assigning the image to the image control it allows the user to draw a shape, for example a rectangle.
Now the problem is that when I am trying to save that image, along with rectangle, the rectangle is not saved (only image is saved).
Please let me know the solution for this problem.
回答1:
To edit images, it is probably easiest to use the WriteableBitmap
class. You can create a WriteableBitmap
instance from any BitmapSource
.
To then edit the image, you can use the WriteableBitmap Extensions library, which among other things contain convenience methods for drawing rectangles in the image.
Finally, if you need instructions on how to save the image, take a look for example here.
来源:https://stackoverflow.com/questions/11220327/how-to-save-an-image-in-bitmap-format-along-with-rectangle-which-is-drawn-on-tha