Table of Contents

Interface IGenericImageHandler

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

Contains methods and properties which allow to work with generic platform independent image.

public interface IGenericImageHandler : IDisposable, ILockImageBits

Properties

AlphaData

Gets or sets alpha component of the pixels using array of byte.

BestStrategy

Gets best strategy to access pixels.

HasAlpha

Returns true if this image has alpha channel, false otherwise.

HasMask

Returns true if there is a mask active, false otherwise.

IsOk

Returns true if image data is present.

LoadFlags

Gets or sets image load flags.

Pixels

Gets or sets pixels using array of SKColor.

RgbData

Gets or sets pixels using array of RGBValue.

Methods

Blur(int)

Blurs the image in both horizontal and vertical directions by the specified blurRadius (in pixels).

BlurHorizontal(int)

Blurs the image in the horizontal direction only.

BlurVertical(int)

Blurs the image in the vertical direction only.

ChangeBrightness(double)

Changes the brightness(value) of each pixel in the image.

ChangeHSV(double, double, double)

Changes the hue, the saturation and the brightness(value) of each pixel in the image.

ChangeSaturation(double)

Changes the saturation of each pixel in the image.

Clear(byte)

Initialize the image data with zeroes (the default) or with the byte value given as value.

ClearAlpha()

Removes the alpha channel from the image.

ConvertAlphaToMask(RGBValue, byte)

Converts alpha components of the image to mask.

ConvertAlphaToMask(byte)

Converts alpha components of the image to mask. Mask color is choosen automatically.

ConvertToGreyscale()

Converts this image to the new grey-scaled image.

ConvertToGreyscale(double, double, double)

Converts image to grayscaled.

ConvertToMono(RGBValue)

Returns monochromatic version of the image.

Copy()

Returns an identical copy of this image.

FindFirstUnusedColor(RGBValue?)

Finds the first color that is never used in the image.

GetAlpha(int, int)

Return alpha value at given pixel location.

GetBlue(int, int)

Returns the blue intensity at the given coordinate.

GetGreen(int, int)

Returns the green intensity at the given coordinate.

GetImageType()

Gets the type of image found when image was loaded or specified when image was saved.

GetMaskBlue()

Gets the blue value of the mask color.

GetMaskGreen()

Gets the green value of the mask color.

GetMaskRGB()

Gets the RGBValue value of the mask color.

GetMaskRed()

Gets the red value of the mask color.

GetOptionAsInt(string)

Gets a user-defined integer-valued option.

GetOptionAsString(string)

Gets a user-defined string-valued option.

GetPixel(int, int, bool)

Gets Color at given pixel location.

GetRGB(int, int)

Gets RGBValue at given pixel location.

GetRed(int, int)

Returns the red intensity at the given coordinate.

GetSubImage(RectI)

Returns a sub image of the current one as long as the rect belongs entirely to the image.

HasOption(string)

Returns true if the given option is present.

InitAlpha()

Initializes the image alpha channel data.

IsTransparent(int, int, byte)

Returns true if the given pixel is transparent, i.e. either has the mask color if this image has a mask or if this image has alpha channel and alpha value of this pixel is strictly less than threshold.

LoadFromStream(Stream, BitmapType, int)

Loads an image from an input stream.

LoadFromStream(Stream, string, int)

Loads an image from an input stream.

Mirror(bool)

Returns a mirrored copy of the image.

Paste(GenericImage, int, int, GenericImageAlphaBlendMode)

Copy the data of the given image to the specified position in this image.

Replace(RGBValue, RGBValue)

Replaces the color specified by (r1.R, r1.G, r1.B) by the color (r2.R, r2.G, r2.B).

Rescale(int, int, GenericImageResizeQuality)

Changes the size of the image in-place by scaling it: after a call to this function,the image will have the given width and height.

Reset()

Destroys the image data.

Reset(int, int, bool)

Creates a fresh image.

ResizeNoScale(SizeI, PointI, RGBValue?)

Changes the size of the image in-place without scaling it by adding either a border with the given color or cropping as necessary.

Rotate180()

Returns a copy of the image rotated by 180 degrees.

Rotate90(bool)

Returns a copy of the image rotated 90 degrees in the direction indicated by clockwise.

RotateHue(double)

Rotates the hue of each pixel in the image by angle, which is a double in the range [-1.0..+1.0], where -1.0 corresponds to -360 degrees and +1.0 corresponds to +360 degrees.

SaveToStream(Stream, BitmapType)

Saves an image in the given stream.

SaveToStream(Stream, string)

Saves an image in the given stream.

Scale(int, int, GenericImageResizeQuality)

Returns a scaled version of the image. This is also useful for scaling bitmaps in general as the only other way to scale bitmaps is to blit a MemoryDC into another MemoryDC.

SetAlpha(int, int, byte)

Sets alpha component of the pixel.

SetImageType(BitmapType)

Sets the type of image returned by GetType().

SetMask(bool)

Specifies whether there is a mask or not.

SetMaskColor(RGBValue)

Sets the mask color for this image(and tells the image to use the mask).

SetMaskFromImage(GenericImage, RGBValue)

Sets image's mask so that the pixels that have RGB value of mr,mg,mb in mask will be masked in the image.

SetOptionAsInt(string, int)

Sets a user-defined option.

SetOptionAsString(string, string)

Sets a user-defined option.

SetPixel(int, int, Color, bool)

Sets the color of the pixel at the given x and y coordinate.

SetRGB(int, int, RGBValue)

Sets the color of the pixel at the given x and y coordinate.

SetRGBRect(RGBValue, RectI?)

Sets the color of the pixels within the given rectangle.

SizeNoScale(SizeI, PointI, RGBValue?)

Returns a resized version of this image without scaling it by adding either a border with the given color or cropping as necessary.