
MyBitmapImage.UriSource = New Uri("C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Water Lilies. ' BitmapImage.UriSource must be in a BeginInit/EndInit block Note: In order to preserve aspect ratio, set DecodePixelWidth cache the image as though it were rendered as its normal size rather than just Hi Yaroslav, Depending on the theme you would like to use, you might need to retemplate the RadButton.In newer theme it can be achieved via a sufficiently large CornerRadius set to the RadButton, but that does not look perfect in all scenarios (some blurring occurs at times, the content does not get clipped properly etc). If you don't do this, the application will height or width of the rendered image. DecodePixelHeight of the BitmapImage value of the image source to the desired To save significant application memory, set the DecodePixelWidth or MyBitmapImage.UriSource = new and Settings\All Users\Documents\My Pictures\Sample Pictures\Water Lilies.jpg") BitmapImage.UriSource must be in a BeginInit/EndInit block Create Image ElementīitmapImage myBitmapImage = new BitmapImage() Setting BitmapImage properties must be done within a BeginInit and EndInit block. The following example shows how to render an image 200 pixels wide using code. For more information, see the Stretch enumeration.

The Stretch property determines how the image source is stretched to fill the image element. When you specify the size of an image with either Width or Height, you should also set either DecodePixelWidth or DecodePixelHeight to the same respective size.
