How to save an image in bitmap format along with rectangle which is drawn on that image

拟墨画扇 提交于 2019-12-02 10:44:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!