DrawingContext.DrawImage Method

Definition

Draws an image into the region defined by the specified Rect.

Overloads

DrawImage(ImageSource, Rect)

Draws an image into the region defined by the specified Rect.

DrawImage(ImageSource, Rect, AnimationClock)

Draws an image into the region defined by the specified Rect and applies the specified animation clock.

DrawImage(ImageSource, Rect)

Draws an image into the region defined by the specified Rect.

C#
public abstract void DrawImage(System.Windows.Media.ImageSource imageSource, System.Windows.Rect rectangle);

Parameters

imageSource
ImageSource

The image to draw.

rectangle
Rect

The region in which to draw bitmapSource.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

DrawImage(ImageSource, Rect, AnimationClock)

Draws an image into the region defined by the specified Rect and applies the specified animation clock.

C#
public abstract void DrawImage(System.Windows.Media.ImageSource imageSource, System.Windows.Rect rectangle, System.Windows.Media.Animation.AnimationClock rectangleAnimations);

Parameters

imageSource
ImageSource

The image to draw.

rectangle
Rect

The region in which to draw bitmapSource.

rectangleAnimations
AnimationClock

The clock with which to animate the rectangle's size and dimensions, or null for no animation. This clock must be created from an AnimationTimeline that can animate Rect objects.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10