c# - How to set Z index when using WPF DrawingContext? -
how set z-index
drawing object when using drawingcontext.drawxxx()
methods?
the object drawn last have higher z index. can't change index of drawn objects. way draw in order.
if using wpf (as placed tag), can use, example, canvas control. create shapes need like
polyline obj = new polyline(); //... // ... set properties of obj
and add them canvas uielementcollection:
yourcanvasname.children.add(obj); //or yourcanvasname.children.insert(i, obj);
first items of collection have higher z index. advantages in way: no need redraw on window changes, can anytime move objects , change order.
Comments
Post a Comment