C# Class Xwt.Backends.ImageBackendHandler

Inheritance: Xwt.Backends.DisposableResourceBackendHandler
Exibir arquivo Open project: antmicro/xwt Class Usage Examples

Public Methods

Method Description
ConvertToBitmap ( object handle, double width, double height, double scaleFactor, ImageFormat format ) : object

Converts an image to a bitmap of the specified size

CopyBitmap ( object handle ) : object
CopyBitmapArea ( object srcHandle, int srcX, int srcY, int width, int height, object destHandle, int destX, int destY ) : void
CreateBackend ( ) : object
CreateCustomDrawn ( ImageDrawCallback drawCallback ) : object

Creates an image that is custom drawn

CreateMultiResolutionImage ( IEnumerable images ) : object

Creates an image with multiple representations in different sizes

The first image of the list if the reference image, the one with scale factor = 1

CreateMultiSizeIcon ( IEnumerable images ) : object
CropBitmap ( object handle, int srcX, int srcY, int width, int height ) : object
GetBitmapPixel ( object handle, int x, int y ) : Color
GetSize ( object handle ) : Size

Gets the size of an image

This method should return a size of (0,0) if the image doesn't have an intrinsic size. For example: if the image is a vecor image, or if is an icon composed of images of different sizes.

GetStockIcon ( string id ) : Image
HasMultipleSizes ( object handle ) : bool

Returns True if the image has multiple representations of different sizes.

For example, it would return True for a .ico file which as several representations of the image in different sizes

IsBitmap ( object handle ) : bool

Determines whether this instance is a bitmap

LoadFromFile ( string file ) : object
LoadFromResource ( Assembly asm, string name ) : object
LoadFromStream ( Stream stream ) : object
SaveToStream ( object backend, System stream, ImageFileType fileType ) : void
SetBitmapPixel ( object handle, int x, int y, Color color ) : void

Method Details

ConvertToBitmap() public abstract method

Converts an image to a bitmap of the specified size
public abstract ConvertToBitmap ( object handle, double width, double height, double scaleFactor, ImageFormat format ) : object
handle object Image handle.
width double Width.
height double Height.
scaleFactor double
format ImageFormat
return object

CopyBitmap() public abstract method

public abstract CopyBitmap ( object handle ) : object
handle object
return object

CopyBitmapArea() public abstract method

public abstract CopyBitmapArea ( object srcHandle, int srcX, int srcY, int width, int height, object destHandle, int destX, int destY ) : void
srcHandle object
srcX int
srcY int
width int
height int
destHandle object
destX int
destY int
return void

CreateBackend() public method

public CreateBackend ( ) : object
return object

CreateCustomDrawn() public method

Creates an image that is custom drawn
public CreateCustomDrawn ( ImageDrawCallback drawCallback ) : object
drawCallback ImageDrawCallback The callback to be used to draw the image. The arguments are: the context backend, the bounds where to draw
return object

CreateMultiResolutionImage() public method

Creates an image with multiple representations in different sizes
The first image of the list if the reference image, the one with scale factor = 1
public CreateMultiResolutionImage ( IEnumerable images ) : object
images IEnumerable Backends of the different image representations
return object

CreateMultiSizeIcon() public method

public CreateMultiSizeIcon ( IEnumerable images ) : object
images IEnumerable
return object

CropBitmap() public abstract method

public abstract CropBitmap ( object handle, int srcX, int srcY, int width, int height ) : object
handle object
srcX int
srcY int
width int
height int
return object

GetBitmapPixel() public abstract method

public abstract GetBitmapPixel ( object handle, int x, int y ) : Color
handle object
x int
y int
return Color

GetSize() public abstract method

Gets the size of an image
This method should return a size of (0,0) if the image doesn't have an intrinsic size. For example: if the image is a vecor image, or if is an icon composed of images of different sizes.
public abstract GetSize ( object handle ) : Size
handle object Image handle
return Size

GetStockIcon() public abstract method

public abstract GetStockIcon ( string id ) : Image
id string
return Image

HasMultipleSizes() public abstract method

Returns True if the image has multiple representations of different sizes.
For example, it would return True for a .ico file which as several representations of the image in different sizes
public abstract HasMultipleSizes ( object handle ) : bool
handle object Image handle.
return bool

IsBitmap() public abstract method

Determines whether this instance is a bitmap
public abstract IsBitmap ( object handle ) : bool
handle object Image handle
return bool

LoadFromFile() public method

public LoadFromFile ( string file ) : object
file string
return object

LoadFromResource() public method

public LoadFromResource ( Assembly asm, string name ) : object
asm System.Reflection.Assembly
name string
return object

LoadFromStream() public abstract method

public abstract LoadFromStream ( Stream stream ) : object
stream Stream
return object

SaveToStream() public abstract method

public abstract SaveToStream ( object backend, System stream, ImageFileType fileType ) : void
backend object
stream System
fileType ImageFileType
return void

SetBitmapPixel() public abstract method

public abstract SetBitmapPixel ( object handle, int x, int y, Color color ) : void
handle object
x int
y int
color Color
return void