C# Class Xwt.Drawing.Image

Inheritance: XwtObject, IDisposable
Afficher le fichier Open project: mono/xwt Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void
GetDefaultSize ( ) : Size

Private Methods

Méthode 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 méthode

public static CreateMultiResolutionImage ( IEnumerable images ) : Image
images IEnumerable
Résultat Image

CreateMultiSizeIcon() public static méthode

public static CreateMultiSizeIcon ( IEnumerable images ) : Image
images IEnumerable
Résultat Image

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

FromCustomLoader() public static méthode

public static FromCustomLoader ( IImageLoader loader, string fileName ) : Image
loader IImageLoader
fileName string
Résultat Image

FromFile() public static méthode

public static FromFile ( string file ) : Image
file string
Résultat Image

FromResource() public static méthode

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
Résultat Image

FromResource() public static méthode

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
Résultat Image

FromResource() public static méthode

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
Résultat Image

FromStream() public static méthode

public static FromStream ( Stream stream ) : Image
stream Stream
Résultat Image

GetDefaultSize() protected méthode

protected GetDefaultSize ( ) : Size
Résultat Size

Image() public méthode

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

Save() public méthode

public Save ( Stream stream, ImageFileType fileType ) : void
stream Stream
fileType ImageFileType
Résultat void

Save() public méthode

public Save ( string file, ImageFileType fileType ) : void
file string
fileType ImageFileType
Résultat void

Scale() public méthode

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
Résultat Image

Scale() public méthode

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
Résultat Image

ToBitmap() public méthode

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

ToBitmap() public méthode

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
Résultat BitmapImage

ToBitmap() public méthode

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
Résultat BitmapImage

ToBitmap() public méthode

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
Résultat BitmapImage

ToBitmap() public méthode

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
Résultat BitmapImage

WithAlpha() public méthode

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
Résultat Image

WithBoxSize() public méthode

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
Résultat Image

WithBoxSize() public méthode

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)
Résultat Image

WithBoxSize() public méthode

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.
Résultat Image

WithSize() public méthode

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
Résultat Image

WithSize() public méthode

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.
Résultat Image

WithSize() public méthode

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)
Résultat Image

WithSize() public méthode

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.
Résultat Image

WithStyles() public méthode

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
Résultat Image