Image myImage = new Image(); myImage.Source = new BitmapImage(new Uri("myImage.png", UriKind.Relative)); ScaleTransform myScaleTransform = new ScaleTransform(2, 2); // scales the image by a factor of 2 in both X and Y directions myImage.RenderTransform = myScaleTransform; //applies the scale transform to the image
Rectangle myRect = new Rectangle(); myRect.Width = 50; myRect.Height = 50; myRect.Fill = Brushes.Blue; ScaleTransform myScaleTransform = new ScaleTransform(0.5, 2); // scales the rectangle by a factor of 0.5 in the X direction and 2 in the Y direction myRect.RenderTransform = myScaleTransform; //applies the scale transform to the rectanglePackage Library: PresentationCore.dll