title: How to scale image from center? Windows 8.1 C#
body: <p>How to scale dynamic image control from the center programmatically in c# for Windows 8.1. This code scales image from left upper corner:                                                         </p>
  
  <pre><code>    Image img=new Image(){Width=150,Height=150};
      img.RenderTransform = new CompositeTransform();
      Storyboard story = new Storyboard();
  
      DoubleAnimation xAnim = new DoubleAnimation();
      DoubleAnimation yAnim = new DoubleAnimation();
  
      xAnim.From = 0;
      yAnim.From = 0;
      xAnim.To = 1;
      yAnim.To = 0.5;
  
      xAnim.Duration = TimeSpan.FromMilliseconds(1000);
      yAnim.Duration = TimeSpan.FromMilliseconds(1500);
  
      story.Children.Add(xAnim);
      story.Children.Add(yAnim);
  
      Storyboard.SetTarget(xAnim, img);
      Storyboard.SetTarget(yAnim, img);
  
      Storyboard.SetTargetProperty(xAnim, "(UIElement.RenderTransform).(CompositeTransform.ScaleX)");
      Storyboard.SetTargetProperty(yAnim, "(UIElement.RenderTransform).(CompositeTransform.ScaleY)");
  
      story.Begin();
  </code></pre>