开发者

WPF present image without background

I have a templatized < Image> on WPF that always has a not-transparent background. As I can not touch the original images, I want to know if there is a way of presenting those images without that background placeholder.

For now, I can assume that the background is a solid white color and the image format I am receiving is JPG. So what I really want is to remove that white surface contouring the real imag开发者_C百科e. It seems to me I will also need to be careful for not touching the parts of the real image that are white, if the technique for removal is based on the color value.


There is no standard property or method that will do this for you.

The best way that I see is:

  1. Read the image and do a flood fill with a transparent color on a pixel that must be transparent.
  2. (Save and) Display the image.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜