将图像作为多边形内容插入



我想在我的Polygon内插入一个Image,可能在Polygon的中心。可能吗?我该怎么办?

您可以使用

ImageBrush作为多边形的Fill。喜欢这个:

<Polygon.Fill>
    <ImageBrush ImageSource="sampleImagesberries.jpg"
                AlignmentX="..." AlignmentY="..." />
</Polygon.Fill>

可能是"Points"属性帮助你:

<Polygon Points="40,0 150,100 10,100" >
   <Polygon.Fill>
       <ImageBrush ImageSource="C:UsersPublicPicturesSample PicturesPenguins.jpg" Stretch="Uniform" AlignmentX="Left" />
   </Polygon.Fill>
</Polygon>

最新更新