如何将图片的不透明部分转换为WPF对象 [英] How to convert the opaque part of a picture to a WPF Obejct

查看:80
本文介绍了如何将图片的不透明部分转换为WPF对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用图片显示一些复杂的图形
如:

I want to use pictures to display some complex graphics
Such as:

DrawingContext dc = this.RenderOpen();
dc.DrawImage(...);
dc.Close();


但是当"OnHitTest"触发时
图片的矩形区域会导致错误判断
所以我想删除图片的透明部分或
将图片的不透明部分转换为WPF对象 我已经在DrawingContext中看到了方法
也许可以使用dc.DrawDrawing()
感谢任何答案.


but when "OnHitTest" triggered
the rectangular region of the picture leads to error judgment
so I want to remove the transparent part of the picture or
convert the opaque part of the picture to a WPF Obejct
I have seen the methods in DrawingContext
maybe dc.DrawDrawing() could be use
thanks to any answers.

推荐答案

我通过判断重点像素解决了该问题
如果是移植过滤器
原谅我可怜的英语...
I solved it by judge the focused Pixels
if it is transplant filter out
forgive my poor English...


这篇关于如何将图片的不透明部分转换为WPF对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆