我有 12 个文件 xaml,如下所示:
<Viewbox
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Width="16"
Height="16">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M11.9997,-0.000199999999999534L11.9997,0.666800000000001 9.9997,1.9998 9.9997,-0.000199999999999534 6.0007,-0.000199999999999534 6.0007,1.9998 5.0007,1.3338 5.0007,-0.000199999999999534 2.0417,-0.000199999999999534 2.0417,1.9568 2.9997,1.9568 2.9997,1.9998 0.999700000000001,1.9998 0.999700000000001,4.9998 -0.000299999999999301,4.9998 -0.000299999999999301,15.9998 16.0007,15.9998 16.0007,4.9998 15.0007,4.9998 15.0007,1.9998 15.0007,-0.000199999999999534z M10.9997,7.9998L12.9997,7.9998 12.9997,13.0008 2.9997,13.0008 2.9997,7.9998 5.0007,7.9998 7.9997,10.9998z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M11,5L12,5 12,4 11,4z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M14.0004,6.0001L14.0004,14.0001 1.9994,14.0001 1.9994,6.0001 0.999400000000001,6.0001 0.999400000000001,15.0001 15.0004,15.0001 15.0004,6.0001z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M3.013,1L3.904,1 3.904,0 3.013,0z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M2,4L3,4 3,3 2,3z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M13,4L14.001,4 14.001,3 13,3z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M3,7L4,7 4,6 3,6z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M12,7L13,7 13,6 12,6z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M13.082,1L13.973,1 13.973,0 13.082,0z" />
<GeometryDrawing Brush="#55aaff" Geometry="F1M7.0002,-0.000199999999999534L7.0002,4.9998 5.2492,3.0008 4.3752,3.0008 4.3752,4.9998 8.0002,8.9998 11.9992,4.9998 11.9992,3.0008 11.0002,3.0008 9.0002,4.9998 9.0002,-0.000199999999999534z" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
几何图形在空间中移动,并且几何图形的数量在文件中并不总是相同的。通过每 120 毫秒顺序加载 xaml 文件,我得到了“gif 效果”。为此,我浪费了内存,此外我还必须管理一个线程。有没有办法用这种类型的资源产生“gif 效果”?所有 12 个文件具有相同的结构:
<Viewbox
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Width="16"
Height="16">
<Rectangle Width="16" Height="16">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
否则是否可以将我的 12 个 .xaml 文件转换为 gif?
非常感谢你的帮助