New to Telerik UI for WPFStart a free 30-day trial

Represents a bitmap in 32bit ARGB format.

Definition

Namespace:Telerik.Windows.Media.Imaging

Assembly:Telerik.Windows.Controls.dll

Syntax:

C#
public class RadBitmap

Inheritance: objectRadBitmap

Constructors

Initializes a new instance of the RadBitmap class using a BitmapSource.

C#
public RadBitmap(BitmapSource image)
Parameters:imageBitmapSource

Initializes a new instance of the RadBitmap class by taking a snapshot of a FrameworkElement.

C#
public RadBitmap(FrameworkElement element)
Parameters:elementFrameworkElement

Initializes a new instance of the RadBitmap class by taking a snapshot of a FrameworkElement with a specified width and height.

C#
public RadBitmap(int width, int height, FrameworkElement element, bool measureAndArrange, double dpiX = 96, double dpiY = 96)
Parameters:widthintheightintelementFrameworkElementmeasureAndArrangebooldpiXdoubledpiYdouble

Initializes a new instance of the RadBitmap class by taking a snapshot of a FrameworkElement with a specified width and height.

C#
public RadBitmap(int width, int height, FrameworkElement element, double dpiX = 96, double dpiY = 96)
Parameters:widthintheightintelementFrameworkElementdpiXdoubledpiYdouble

Initializes a new instance of the RadBitmap class by using a pixels array with a specified width and height.

C#
public RadBitmap(int width, int height, int[] pixels, double dpiX = 96, double dpiY = 96)
Parameters:widthintheightintpixelsint[]dpiXdoubledpiYdouble

Initializes a new instance of the RadBitmap class copying the contents from another bitmap.

C#
public RadBitmap(RadBitmap other)
Parameters:otherRadBitmap

Initializes a new instance of the RadBitmap class form an instance of RadBitmapData.

C#
public RadBitmap(RadBitmapData data)
Parameters:dataRadBitmapData

Initializes a new instance of the RadBitmap class using a Stream.

C#
public RadBitmap(Stream streamSource)
Parameters:streamSourceStream

Initializes a new instance of the RadBitmap class using a WriteableBitmap as a source.

C#
public RadBitmap(WriteableBitmap writableBitmap)
Parameters:writableBitmapWriteableBitmap

Properties

Bitmap

WriteableBitmap

Gets the WriteableBitmap instance associated with this RadBitmap.

C#
public WriteableBitmap Bitmap { get; }

Gets the height in pixels of this RadBitmap.

C#
public int Height { get; }

Gets the width in pixels of this RadBitmap.

C#
public int Width { get; }

Methods

Returns a cropped copy of this RadBitmap.

C#
public RadBitmap Crop(int x, int y, int newWidth, int newHeight)
Parameters:xint

The X coordinate of the crop rectangle.

yint

The Y coordinate of the crop rectangle.

newWidthint

The width of the crop rectangle.

newHeightint

The height of the crop rectangle.

Returns:

RadBitmap

Gets the pixels array of this RadBitmap in 32bit ARGB format.

C#
public int[] GetPixels()
Returns:

int[]

Returns a resized copy of this RadBitmap.

C#
public RadBitmap Resize(int newWidth, int newHeight)
Parameters:newWidthint

The desired width of the result.

newHeightint

The desired width of the result.

Returns:

RadBitmap

The resized RadBitmap.

Returns a rotated copy of this RadBitmap.

C#
public RadBitmap Rotate(double degrees, Color backgroundColor)
Parameters:degreesdouble

The angle to rotate the bitmap in degrees. Positive angles are clockwise.

backgroundColorColor

The color with which to fill the empty spaces.

Returns:

RadBitmap

The rotated RadBitmap.