Class Image
Describes an image to be drawn on a Graphics or displayed in a UI control.
[TypeConverter(typeof(ImageConverter))]
public class Image : HandledObject<IImageHandler>, IBaseObjectWithId, IImmutableObject, IDisposableObject, IDisposable, IBaseObject, INotifyPropertyChanged
- Inheritance
-
Image
- Implements
- Derived
Constructors
- Image(IImageHandler)
Initializes a new instance of the Image class.
Fields
- DefaultSaveQuality
Gets or sets default quality used when images are saved and quality parameter is omitted.
- GrayScale
Occurs when ToGrayScale() is called. Used to override default grayscale method.
Properties
- AsBrush
Creates texture brush with this image.
- AsGeneric
Converts this object to GenericImage.
- BitsFormat
Gets ImageBitsFormat for this image.
- Bounds
Gets image bounds in pixels. This method returns (0, 0, Width, Height).
- Canvas
Gets Graphics which allows to draw on the image. Same as GetDrawingContext().
- DefaultBitmapType
Gets default BitmapType value for the current operating system.
- Depth
Gets the color depth of the image. Returned value is 32, 24, or other.
- DipSize
Gets the size of bitmap in DPI-independent units.
- ExtensionsForLoad
Gets or sets list of extensions (including ".") which can be used to filter out supported image formats when using OpenFileDialog.
- ExtensionsForSave
Gets or sets list of extensions (including ".") which can be used to filter out supported image formats when using SaveFileDialog.
- HasAlpha
Gets or sets whether this image has an alpha channel.
- HasMask
Gets whether this image has mask.
- Height
Gets image height in pixels.
- IsEmpty
Gets whether image is empty (is disposed or has an empty width or height).
- IsOk
Gets whether image is ok (is not disposed and has non-zero width and height).
- PixelHeight
Gets image height in pixels.
- PixelSize
Gets the size of the image in pixels.
- PixelWidth
Gets image width in pixels.
- ScaleFactor
Gets or sets the scale factor of this image.
- ScaledHeight
Gets the height of the bitmap in logical pixels.
- ScaledSize
Gets the size of the bitmap in logical pixels.
- ScaledWidth
Gets the width of the bitmap in logical pixels.
- Size
Gets image size in pixels.
- Url
Gets or sets source url of this image. This is informational property and doesn't reload the image.
- Width
Gets image width in pixels.
Methods
- Assign(GenericImage)
Assigns GenericImage to this image.
- Assign(SKBitmap)
Assigns SKBitmap to this image.
- BoundsDip(AbstractControl)
Gets image rect as (0, 0, SizeDip(control).Width, SizeDip(control).Height).
- BoundsDip(double)
Gets image rect as (0, 0, SizeDip(scaleFactor).Width, SizeDip(scaleFactor).Height).
- ChangeLightness(int)
Creates new image using pixels of this image with changed lightness.
- ClearCachedImages()
Clears images cache used in FromUrlCached(string).
- Clone()
Creates a clone of this image with fully copied image data.
- ConvertToDisabled(byte)
Returns disabled (dimmed) version of the image.
- Create(int, int, Color)
Creates image with the specified size, filled with
color
.
- Create(int, int, SKColor[])
Creates image with the specified size and pixel data.
- CreateHandler()
Creates handler.
- FromAssemblyUrl(Assembly, string)
Initializes a new instance of the Image class from the specified relative url and assembly.
- FromScreen()
Creates images with screen pixels.
- FromStream(Stream)
Creates an Image from the specified data stream.
- FromSvgStream(Stream, int, int, Color?)
Initializes a new instance of the Image class from the specified Stream which contains svg data.
- FromSvgString(string, int, int, Color?)
Initializes a new instance of the Image class from the specified string which contains svg data.
- FromSvgUrl(string, int, int, Color?)
Initializes a new instance of the Image class from the specified url which points to svg file or resource.
- FromSvgUrlForToolbar(string, IControl, Color?)
Initializes a new instance of the Image class from the specified url which points to svg file or resource.
- FromUrl(string, BitmapType)
Initializes a new instance of the Image class from the specified url. Raises exceptions on errors.
- FromUrlCached(string)
Initializes a new instance of the Image class from the specified url. Do not raise exceptions on errors, just returns Null image. Uses image cache, so the bitmap with the same url is loaded faster for second time.
- FromUrlOrNull(string)
Initializes a new instance of the Image class from the specified url. Returns null if error occurs during image load. No exceptions are raised.
- GetBitmapTypeFromFileName(string)
Gets BitmapType from the extension of the
fileName
.
- GetDrawingContext()
Gets Graphics for this image on which you can paint.
- GetSubBitmap(RectI)
Returns a sub image of the current one as long as the
rect
belongs entirely to the image.
- IsNotNullAndOk(Image?)
Indicates whether the specified image is not
null
and has non-empty width and height.
- IsNullOrEmpty(Image?)
Indicates whether the specified image is
null
or has an empty width (or height).
- Load(Stream, BitmapType)
Loads an image from an input stream.
- Load(string, BitmapType)
Loads an image from a file or resource.
- LockSurface(ImageLockMode)
Gets ISkiaSurface for this image.
- Rescale(SizeI)
Rescales this image to the requested size.
- ResetAlpha()
Resets alpha channel.
- Save(Stream, ImageFormat, int?)
Saves this image to the specified stream in the specified format.
- Save(Stream, BitmapType, int?)
Saves this image to the specified stream in the specified format defined in
type
.
- Save(string, BitmapType, int?)
Saves this Image to the specified file.
- Save(string, int?)
Saves this Image to the specified file.
- SetDPI(SizeD)
Sets ScaleFactor using DPI value.
- SizeDip(AbstractControl)
Gets the size of the image in device-independent units.
- SizeDip(double)
Gets the size of the image in device-independent units using the specified scale factor.
- ToGrayScale()
Creates grayscaled version of the image.
- ToString()
Returns a string that represents the current object.
- WithConvertedColors(Func<ColorStruct, ColorStruct>)
Creates an new image from this image with all pixels converted using the specified function.
- WithLightColors()
Creates an new image from this image with all pixels lighter
- WithLightLightColors()
Creates an new image from this image with all pixels lighter (this method makes 2x lighter than WithLightColors()).
Operators
- explicit operator Image(GenericImage)
Converts the specified GenericImage to a Image.
- explicit operator GenericImage(Image)
Converts the specified GenericImage to a Image.