C# Класс Xwt.Drawing.Image

Наследование: XwtObject, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void
GetDefaultSize ( ) : Size

Приватные методы

Метод Описание
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

Описание методов

CreateMultiResolutionImage() публичный статический Метод

public static CreateMultiResolutionImage ( IEnumerable images ) : Image
images IEnumerable
Результат Image

CreateMultiSizeIcon() публичный статический Метод

public static CreateMultiSizeIcon ( IEnumerable images ) : Image
images IEnumerable
Результат Image

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

FromCustomLoader() публичный статический Метод

public static FromCustomLoader ( IImageLoader loader, string fileName ) : Image
loader IImageLoader
fileName string
Результат Image

FromFile() публичный статический Метод

public static FromFile ( string file ) : Image
file string
Результат Image

FromResource() публичный статический Метод

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
Результат Image

FromResource() публичный статический Метод

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
Результат Image

FromResource() публичный статический Метод

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
Результат Image

FromStream() публичный статический Метод

public static FromStream ( Stream stream ) : Image
stream Stream
Результат Image

GetDefaultSize() защищенный Метод

protected GetDefaultSize ( ) : Size
Результат Size

Image() публичный Метод

Creates a new image that is a copy of another image
public Image ( Image image ) : System
image Image Image.
Результат System

Save() публичный Метод

public Save ( Stream stream, ImageFileType fileType ) : void
stream Stream
fileType ImageFileType
Результат void

Save() публичный Метод

public Save ( string file, ImageFileType fileType ) : void
file string
fileType ImageFileType
Результат void

Scale() публичный Метод

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
Результат Image

Scale() публичный Метод

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
Результат Image

ToBitmap() публичный Метод

Converts the image to a bitmap
public ToBitmap ( ImageFormat format = ImageFormat.ARGB32 ) : BitmapImage
format ImageFormat Bitmap format
Результат BitmapImage

ToBitmap() публичный Метод

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
Результат BitmapImage

ToBitmap() публичный Метод

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
Результат BitmapImage

ToBitmap() публичный Метод

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
Результат BitmapImage

ToBitmap() публичный Метод

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
Результат BitmapImage

WithAlpha() публичный Метод

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
Результат Image

WithBoxSize() публичный Метод

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
Результат Image

WithBoxSize() публичный Метод

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)
Результат Image

WithBoxSize() публичный Метод

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.
Результат Image

WithSize() публичный Метод

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
Результат Image

WithSize() публичный Метод

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.
Результат Image

WithSize() публичный Метод

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)
Результат Image

WithSize() публичный Метод

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.
Результат Image

WithStyles() публичный Метод

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
Результат Image