Class
RadBitmap

Represents a bitmap in 32bit ARGB format.

Definition

Namespace:Telerik.Windows.Media.Imaging

Assembly:Telerik.Windows.Controls.dll

Syntax:

cs-api-definition
public class RadBitmap

Inheritance: objectRadBitmap

Constructors

RadBitmap(BitmapSource)

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

Declaration

cs-api-definition
public RadBitmap(BitmapSource image)

Parameters

image

BitmapSource

RadBitmap(FrameworkElement)

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

Declaration

cs-api-definition
public RadBitmap(FrameworkElement element)

Parameters

element

FrameworkElement

RadBitmap(RadBitmap)

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

Declaration

cs-api-definition
public RadBitmap(RadBitmap other)

Parameters

other

RadBitmap

RadBitmap(RadBitmapData)

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

Declaration

cs-api-definition
public RadBitmap(RadBitmapData data)

Parameters

data

RadBitmapData

RadBitmap(Stream)

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

Declaration

cs-api-definition
public RadBitmap(Stream streamSource)

Parameters

streamSource

Stream

RadBitmap(WriteableBitmap)

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

Declaration

cs-api-definition
public RadBitmap(WriteableBitmap writableBitmap)

Parameters

writableBitmap

WriteableBitmap

RadBitmap(int, int, FrameworkElement, bool, double, double)

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

Declaration

cs-api-definition
public RadBitmap(int width, int height, FrameworkElement element, bool measureAndArrange, double dpiX = 96, double dpiY = 96)

Parameters

width

int

height

int

element

FrameworkElement

measureAndArrange

bool

dpiX

double

dpiY

double

RadBitmap(int, int, FrameworkElement, double, double)

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

Declaration

cs-api-definition
public RadBitmap(int width, int height, FrameworkElement element, double dpiX = 96, double dpiY = 96)

Parameters

width

int

height

int

element

FrameworkElement

dpiX

double

dpiY

double

RadBitmap(int, int, int[], double, double)

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

Declaration

cs-api-definition
public RadBitmap(int width, int height, int[] pixels, double dpiX = 96, double dpiY = 96)

Parameters

width

int

height

int

pixels

int[]

dpiX

double

dpiY

double

Properties

Bitmap

Gets the WriteableBitmap instance associated with this RadBitmap.

Declaration

cs-api-definition
public WriteableBitmap Bitmap { get; }

Property Value

WriteableBitmap

Height

Gets the height in pixels of this RadBitmap.

Declaration

cs-api-definition
public int Height { get; }

Property Value

int

Width

Gets the width in pixels of this RadBitmap.

Declaration

cs-api-definition
public int Width { get; }

Property Value

int

Methods

Crop(int, int, int, int)

Returns a cropped copy of this RadBitmap.

Declaration

cs-api-definition
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "x")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "y")]
public RadBitmap Crop(int x, int y, int newWidth, int newHeight)

Parameters

x

int

The X coordinate of the crop rectangle.

y

int

The Y coordinate of the crop rectangle.

newWidth

int

The width of the crop rectangle.

newHeight

int

The height of the crop rectangle.

Returns

RadBitmap

GetPixels()

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

Declaration

cs-api-definition
public int[] GetPixels()

Returns

int[]

Resize(int, int)

Returns a resized copy of this RadBitmap.

Declaration

cs-api-definition
public RadBitmap Resize(int newWidth, int newHeight)

Parameters

newWidth

int

The desired width of the result.

newHeight

int

The desired width of the result.

Returns

RadBitmap

The resized RadBitmap.

Rotate(double, Color)

Returns a rotated copy of this RadBitmap.

Declaration

cs-api-definition
public RadBitmap Rotate(double degrees, Color backgroundColor)

Parameters

degrees

double

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

backgroundColor

Color

The color with which to fill the empty spaces.

Returns

RadBitmap

The rotated RadBitmap.