The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Image.Source Property
Visual Studio 2008
Gets or sets the ImageSource for the image. This is a dependency property.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
'Declaration Public Property Source As ImageSource 'Usage Dim instance As Image Dim value As ImageSource value = instance.Source instance.Source = value
<object Source="imageUri"/>
For XAML information, see the ImageSource type.
XAML Values
Property Value
Type: System.Windows.Media.ImageSourceThe source of the drawn image. The default value is Nothing.
The following example demonstrates how to use the Source property.
Dim myImage3 As New Image Dim bi3 As New BitmapImage bi3.BeginInit() bi3.UriSource = New Uri("smiley_stackpanel.PNG", UriKind.Relative) bi3.EndInit() myImage3.Stretch = Stretch.Fill myImage3.Source = bi3
<Image Source="smiley_stackpanel.png" Stretch="Fill"/>
More Code
| How to: Use the Image Element | This example shows how to include images in an application by using the Image element. |
| How to: Use a Drawing as an Image Source | This example shows how to use a Drawing as the Source for an Image control. To display a Drawing with an Image control, use a DrawingImage as the Image control's Source and set the DrawingImage object's DrawingImage.Drawing property to the drawing you want to display. |
| How to: Crop an Image | This example shows how to crop an image using CroppedBitmap. |
| How to: Rotate an Image | This example shows how to rotate an image 90 degrees by using a Rotation property of a BitmapImage. |
| How to: Convert an Image to Greyscale | This example shows how to convert an image to grayscale using FormatConvertedBitmap. |
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Community Additions
Show: