我有一些表达设计中的艺术品(图像),我想在 WPF 中用作Image
. 这样做的原因是它是一组图标的一部分,将用于我的应用程序的用户可以放大的区域,我希望它可以缩放。
我的图像具有高斯模糊效果,我不知道如何将其转换为我的DrawingImage
. 当我尝试从表情设计中导出时,即使从警告中它告诉我它可以导出高斯模糊,它也不会。它将绘图的这一部分导出为 PNG 图像。
这是我到目前为止所得到的:
当我将 XAML 从 Expression Design 复制粘贴到 Expression Blend 时,我得到以下 XAML
<Path Stretch="Fill" Fill="#B3000000" Data="F1 M 116.013,62.3682C 140.838,63.5389 160.541,73.4323 160.02,84.4657C 159.5,95.4992 138.954,103.494 114.128,102.324C 89.3031,101.153 69.6001,91.2596 70.1204,80.2262C 70.6407,69.1927 91.1874,61.1974 116.013,62.3682 Z " HorizontalAlignment="Left" Height="40.184" Margin="70.11,62.254,0,0" VerticalAlignment="Top" Width="89.92">
<Path.Effect>
<BlurEffect Radius="1.88976"/>
</Path.Effect>
</Path>
<Ellipse Stretch="Fill" HorizontalAlignment="Left" Height="83.25" Margin="88.042,19.708,0,0" VerticalAlignment="Top" Width="83.25">
<Ellipse.Fill>
<RadialGradientBrush RadiusX="0.675" RadiusY="0.675" Center="0.660714,0.339286" GradientOrigin="0.660714,0.339286">
<RadialGradientBrush.RelativeTransform>
<TransformGroup/>
</RadialGradientBrush.RelativeTransform>
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#FFBC0D0D" Offset="1"/>
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
我转换为:
<DrawingImage x:Key="redSphere">
<DrawingImage.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#B3000000" Geometry="F1 M 48.6792,44.0348C 73.5045,45.2056 93.2075,55.099 92.6872,66.1324C 92.1668,77.1658 71.6202,85.1612 46.795,83.9904C 21.9698,82.8197 2.26675,72.9263 2.78708,61.8928C 3.3074,50.8594 23.854,42.8641 48.6792,44.0348 Z "/>
<GeometryDrawing Geometry="F1 M 62.3333,1.37501C 85.3222,1.37501 103.958,20.0112 103.958,43C 103.958,65.9889 85.3222,84.625 62.3333,84.625C 39.3445,84.625 20.7083,65.9889 20.7083,43C 20.7083,20.0112 39.3445,1.37501 62.3333,1.37501 Z ">
<GeometryDrawing.Brush>
<RadialGradientBrush RadiusX="0.675" RadiusY="0.675" Center="0.660714,0.339286" GradientOrigin="0.660714,0.339286">
<RadialGradientBrush.GradientStops>
<GradientStop Color="#FFFFFFFF" Offset="0"/>
<GradientStop Color="#FFBC0D0D" Offset="1"/>
</RadialGradientBrush.GradientStops>
<RadialGradientBrush.RelativeTransform>
<TransformGroup/>
</RadialGradientBrush.RelativeTransform>
</RadialGradientBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
我的问题是,现在我无法弄清楚我的BlurEffect
.