c# - How to shrink image to disappear gradually in WPF DoubleAnimation -
so, i'm making application , want gradually (over course of few seconds) shrink image control until disappears. so, bound scaletransform doubleanimation, happens instantly. here code:
doubleanimation anim = new doubleanimation(360, 0, (duration)timespan.fromseconds(1)); scaletransform st = new scaletransform(); st.scalex = 0; st.scaley = 0; pacscore.rendertransform = st; anim.completed += (s, _) => exit_pacs(); st.beginanimation(scaletransform.scaleyproperty, anim);
this should trick:
doubleanimation anim = new doubleanimation(1, 0,(duration)timespan.fromseconds(1)); scaletransform st = new scaletransform(); control.rendertransform = st; st.beginanimation(scaletransform.scalexproperty, anim); st.beginanimation(scaletransform.scaleyproperty, anim);
Comments
Post a Comment