Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF:在元素内添加边框_C#_Wpf_Image_Border - Fatal编程技术网

C# WPF:在元素内添加边框

C# WPF:在元素内添加边框,c#,wpf,image,border,C#,Wpf,Image,Border,我想知道是否有办法在图像中添加边框。我想要Photoshop中的“笔划”效果,当位置设置为“内部”时,即必须在图像上绘制。可能吗 谢谢。您可以将边框放置在图像顶部: <Grid> <Image/> <Border/> </Grid> 是的,你可以做一个多层的方法 <Grid> <Image /> <Border horizontalAlignment="Stretch" verticalAlign

我想知道是否有办法在图像中添加边框。我想要Photoshop中的“笔划”效果,当位置设置为“内部”时,即必须在图像上绘制。可能吗


谢谢。

您可以将边框放置在图像顶部:

<Grid>
 <Image/>
 <Border/>
</Grid>

是的,你可以做一个多层的方法

<Grid>
    <Image />
    <Border horizontalAlignment="Stretch" verticalAlignment="Stretch" />
</Grid>

提醒您需要使用的属性,这只是一个轻量级版本

我想那很容易

<Grid>
    <Image />
    <Border/>
</Grid>

它可以工作,但如果我设置一个角半径,图像的“尖角”在边界之外是可见的。。。
<Grid>
    <Image />
    <Border/>
</Grid>