更新时间:2023-01-28 18:40:32
我会尝试使用 OpacityMask 方法.基本上它应该是这样的:
I would try OpacityMask approach. Basicaly it should look something like this:
<Rectangle Fill="Red">
<Rectangle.OpacityMask>
<ImageBrush ImageSource="MyImage.png"/>
</Rectangle.OpacityMask>
</Rectangle>
通过改变矩形的填充属性,你会得到不同颜色的图像.
by changing rectangle's fill property you would get different colored image.