【问题标题】:Insert Image as Polygon Content将图像作为多边形内容插入
【发布时间】:2012-06-26 10:13:35
【问题描述】:

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

【问题讨论】:

    标签: c# wpf image polygon


    【解决方案1】:

    您可以使用ImageBrush 作为多边形的Fill。像这样:

    <Polygon.Fill>
        <ImageBrush ImageSource="sampleImages\berries.jpg"
                    AlignmentX="..." AlignmentY="..." />
    </Polygon.Fill>
    

    【讨论】:

    【解决方案2】:

    可能是“点”属性帮助你:

    <Polygon Points="40,0 150,100 10,100" >
       <Polygon.Fill>
           <ImageBrush ImageSource="C:\Users\Public\Pictures\Sample Pictures\Penguins.jpg" Stretch="Uniform" AlignmentX="Left" />
       </Polygon.Fill>
    </Polygon>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-24
      • 2013-04-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多