The size of an image control either can be set explicitly using its Width
and Height
properties, or the image can depend on its container to determine its size. If the container is a simple container such as a Canvas
, the Image
will be displayed using the native dimensions defined in the image file. The Image.Stretch
property is used to control the sizing behavior of the Image
when its size differs from its native image size. The Stretch
property is of type System.Windows.Media.Stretch
, whose values are described in Table 7.1.
The effects of each of these enum values on image sizing are depicted in Figure 7.1.
The source for this section is located on the MediaExamplesView.xaml page in the ControlExamples directory of the WPUnleashed.Examples project in the downloadable sample code.
3.135.200.14