Image Sizing

,

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.

TABLE 7.1. Stretch Enum Values and Their Effect on Image Sizing

Image

The effects of each of these enum values on image sizing are depicted in Figure 7.1.

Image

FIGURE 7.1 The Image.Stretch property determines how an image is sized.

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.201.71