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

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -