【发布时间】:2011-02-13 05:41:04
【问题描述】:
我想点击测试图像的内容。为此,我创建了BitmapImage 并使用DrawingContext.DrawImage() 方法将其绘制在DrawingVisual 内。使用VisualTreeHelper.HitTest() 对其进行命中测试时,图像中的每个点都返回true,但是我希望白色像素返回false,非白色像素返回true。所以我使用FormatConvertedBitmap 将BitmapImage 转换为黑白像素格式,但它也不起作用。有什么建议么?如果我可以对ImageDrawing 对象进行测试会更好。
【问题讨论】: