C# Class Xwt.Drawing.Image

Inheritance: XwtObject, IDisposable
Show file Open project: mono/xwt Class Usage Examples

Public Methods

Method Description
CreateMultiResolutionImage ( IEnumerable images ) : Image
CreateMultiSizeIcon ( IEnumerable images ) : Image
Dispose ( ) : void
FromCustomLoader ( IImageLoader loader, string fileName ) : Image
FromFile ( string file ) : Image
FromResource ( Assembly assembly, string resource ) : Image

Loads an image from a resource

This method will look for alternative versions of the image with different resolutions. For example, if a resource is named "foo.png", this method will load other resources with the name "[email protected]", where XXX can be any arbitrary string. For example "[email protected]". Each of those resources will be considered different versions of the same image.

FromResource ( Type type, string resource ) : Image

Loads an image from a resource

This method will look for alternative versions of the image with different resolutions. For example, if a resource is named "foo.png", this method will load other resources with the name "[email protected]", where XXX can be any arbitrary string. For example "[email protected]". Each of those resources will be considered different versions of the same image.

FromResource ( string resource ) : Image

Loads an image from a resource

This method will look for alternative versions of the image with different resolutions. For example, if a resource is named "foo.png", this method will load other resources with the name "[email protected]", where XXX can be any arbitrary string. For example "[email protected]". Each of those resources will be considered different versions of the same image.

FromStream ( Stream stream ) : Image
Image ( Image image ) : System

Creates a new image that is a copy of another image

Save ( Stream stream, ImageFileType fileType ) : void
Save ( string file, ImageFileType fileType ) : void
Scale ( double scale ) : Image

Retuns a scaled copy of the image

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

Scale ( double scaleX, double scaleY ) : Image

Retuns a scaled copy of the image

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

ToBitmap ( ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage

Converts the image to a bitmap

ToBitmap ( Screen renderTarget, ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage

Converts the image to a bitmap

ToBitmap ( Widget renderTarget, ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage

Converts the image to a bitmap

ToBitmap ( WindowFrame renderTarget, ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage

Converts the image to a bitmap

ToBitmap ( double scaleFactor, ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage

Converts the image to a bitmap

WithAlpha ( double alpha ) : Image

Applies an alpha filter to the image

This is a lightweight operation. The alpha filter is applied when the image is rendered. The method doesn't make a copy of the image data.

WithBoxSize ( Size size ) : Image

Retuns a copy of the image with a size that fits the provided size limits

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

WithBoxSize ( double maxSize ) : Image

Retuns a copy of the image with a size that fits the provided size limits

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

WithBoxSize ( double maxWidth, double maxHeight ) : Image

Retuns a copy of the image with a size that fits the provided size limits

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

WithSize ( IconSize size ) : Image

Retuns a copy of the image with a specific size

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

WithSize ( Size size ) : Image

Retuns a copy of the image with a specific size

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

WithSize ( double squaredSize ) : Image

Retuns a copy of the image with a specific size

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

WithSize ( double width, double height ) : Image

Retuns a copy of the image with a specific size

This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.

WithStyles ( ) : Image

Retuns a copy of the image with a set of specific styles

This is a lightweight operation. The method doesn't make a copy of the image data.

Protected Methods

Method Description
Dispose ( bool disposing ) : void
GetDefaultSize ( ) : Size

Private Methods

Method Description
CreateComposedNinePatch ( Toolkit toolkit, IEnumerable altImages ) : Image
FromCustomLoader ( IImageLoader loader, string fileName, ImageTagSet tags ) : Image
GetExtension ( string fileName ) : string
GetFixedSize ( ) : Size
GetImageDescription ( Toolkit toolkit ) : ImageDescription
Image ( ) : System
Image ( object backend ) : System
Image ( object backend, Toolkit toolkit ) : System
Init ( ) : void
InitForToolkit ( Toolkit t ) : void
LoadImage ( ImageLoader loader, string fileName, ImageTagSet tagFilter ) : Image
ParseImageHints ( string baseName, string fileName, string ext, int &scale, ImageTagSet &tags ) : bool

Method Details

CreateMultiResolutionImage() public static method

public static CreateMultiResolutionImage ( IEnumerable images ) : Image
images IEnumerable
return Image

CreateMultiSizeIcon() public static method

public static CreateMultiSizeIcon ( IEnumerable images ) : Image
images IEnumerable
return Image

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

FromCustomLoader() public static method

public static FromCustomLoader ( IImageLoader loader, string fileName ) : Image
loader IImageLoader
fileName string
return Image

FromFile() public static method

public static FromFile ( string file ) : Image
file string
return Image

FromResource() public static method

Loads an image from a resource
This method will look for alternative versions of the image with different resolutions. For example, if a resource is named "foo.png", this method will load other resources with the name "[email protected]", where XXX can be any arbitrary string. For example "[email protected]". Each of those resources will be considered different versions of the same image.
public static FromResource ( Assembly assembly, string resource ) : Image
assembly System.Reflection.Assembly The assembly from which to load the image
resource string Resource name
return Image

FromResource() public static method

Loads an image from a resource
This method will look for alternative versions of the image with different resolutions. For example, if a resource is named "foo.png", this method will load other resources with the name "[email protected]", where XXX can be any arbitrary string. For example "[email protected]". Each of those resources will be considered different versions of the same image.
public static FromResource ( Type type, string resource ) : Image
type System.Type Type which identifies the assembly from which to load the image
resource string Resource name
return Image

FromResource() public static method

Loads an image from a resource
This method will look for alternative versions of the image with different resolutions. For example, if a resource is named "foo.png", this method will load other resources with the name "[email protected]", where XXX can be any arbitrary string. For example "[email protected]". Each of those resources will be considered different versions of the same image.
public static FromResource ( string resource ) : Image
resource string Resource name
return Image

FromStream() public static method

public static FromStream ( Stream stream ) : Image
stream Stream
return Image

GetDefaultSize() protected method

protected GetDefaultSize ( ) : Size
return Size

Image() public method

Creates a new image that is a copy of another image
public Image ( Image image ) : System
image Image Image.
return System

Save() public method

public Save ( Stream stream, ImageFileType fileType ) : void
stream Stream
fileType ImageFileType
return void

Save() public method

public Save ( string file, ImageFileType fileType ) : void
file string
fileType ImageFileType
return void

Scale() public method

Retuns a scaled copy of the image
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public Scale ( double scale ) : Image
scale double Scale to apply to the image size
return Image

Scale() public method

Retuns a scaled copy of the image
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public Scale ( double scaleX, double scaleY ) : Image
scaleX double Scale to apply to the width of the image
scaleY double Scale to apply to the height of the image
return Image

ToBitmap() public method

Converts the image to a bitmap
public ToBitmap ( ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage
format ImageFormat Bitmap format
return BitmapImage

ToBitmap() public method

Converts the image to a bitmap
public ToBitmap ( Screen renderTarget, ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage
renderTarget Screen Screen to be used as reference for determining the resolution of the bitmap
format ImageFormat Bitmap format
return BitmapImage

ToBitmap() public method

Converts the image to a bitmap
public ToBitmap ( Widget renderTarget, ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage
renderTarget Widget Widget to be used as reference for determining the resolution of the bitmap
format ImageFormat Bitmap format
return BitmapImage

ToBitmap() public method

Converts the image to a bitmap
public ToBitmap ( WindowFrame renderTarget, ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage
renderTarget WindowFrame Window to be used as reference for determining the resolution of the bitmap
format ImageFormat Bitmap format
return BitmapImage

ToBitmap() public method

Converts the image to a bitmap
public ToBitmap ( double scaleFactor, ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage
scaleFactor double Scale factor of the bitmap
format ImageFormat Bitmap format
return BitmapImage

WithAlpha() public method

Applies an alpha filter to the image
This is a lightweight operation. The alpha filter is applied when the image is rendered. The method doesn't make a copy of the image data.
public WithAlpha ( double alpha ) : Image
alpha double Alpha to apply
return Image

WithBoxSize() public method

Retuns a copy of the image with a size that fits the provided size limits
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithBoxSize ( Size size ) : Image
size Size Max width and height
return Image

WithBoxSize() public method

Retuns a copy of the image with a size that fits the provided size limits
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithBoxSize ( double maxSize ) : Image
maxSize double Max width and height (the image is expected to be squared)
return Image

WithBoxSize() public method

Retuns a copy of the image with a size that fits the provided size limits
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithBoxSize ( double maxWidth, double maxHeight ) : Image
maxWidth double Max width.
maxHeight double Max height.
return Image

WithSize() public method

Retuns a copy of the image with a specific size
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithSize ( IconSize size ) : Image
size IconSize New size
return Image

WithSize() public method

Retuns a copy of the image with a specific size
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithSize ( Size size ) : Image
size Size The size.
return Image

WithSize() public method

Retuns a copy of the image with a specific size
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithSize ( double squaredSize ) : Image
squaredSize double Width and height of the image (the image is expected to be squared)
return Image

WithSize() public method

Retuns a copy of the image with a specific size
This is a lightweight operation. The image is scaled when it is rendered. The method doesn't make a copy of the image data.
public WithSize ( double width, double height ) : Image
width double Width.
height double Height.
return Image

WithStyles() public method

Retuns a copy of the image with a set of specific styles
This is a lightweight operation. The method doesn't make a copy of the image data.
public WithStyles ( ) : Image
return Image