我有DrawingVisual
一棵葡萄树,想画一棵葡萄树,然后在屏幕上显示,然后画一只狐狸。像这样:
public class Gif : DrawingVisual
{
void Draw_Geometry(Geometry geo)
{
using (DrawingContext dc = RenderOpen())
{
dc.DrawGeometry(Brushes.Brown, new Pen(Brushes.Brown, 0), geo);
}
}
void Draw_Grape ()
{
Draw_Geometry(grape);
}
void Draw_Fox ()
{
Draw_Geometry(fox);
}
}
问题是调用时Draw_Fox ()
,DrawingContext
自动清除现有的葡萄树。所以想问一下在绘制新几何体时如何保留现有的绘图内容?感谢!