[]
Represents an uncompressed in-memory bitmap in 32-bit ARGB format (A is the most significant byte).
public class GcBitmap : IImage, IDisposable
Public Class GcBitmap
Implements IImage, IDisposable
Name | Description |
---|---|
GcBitmap() | Initializes an empty instance of the GcBitmap class. |
GcBitmap(Image, Rectangle?, bool) | Initializes a new instance of the GcBitmap class. |
GcBitmap(byte[], int, Rectangle?, bool) | Initializes a new instance of the GcBitmap class. |
GcBitmap(Stream, int, Rectangle?, bool) | Initializes a new instance of the GcBitmap class. |
GcBitmap(int, int, bool, float, float, bool) | Initializes a new instance of the GcBitmap class and creates the image. The image content is not initialized and can contain any random data. If subsequent rendering is going to cover the whole surface of the bitmap, or if CreateGraphics(Color?) will be called on the bitmap with a non-null background color, clearing it (which is a lengthy operation for large bitmaps) is not needed. If some areas of the bitmap are going to be left untouched, they must be cleared to avoid the possibility of random artifacts showing. |
GcBitmap(IntPtr, int, int, bool, bool, float, float) | Initializes a new instance of the GcBitmap class and sets the existing pixel data to be read/modified in-place. |
GcBitmap(string, int, Rectangle?, bool) | Initializes a new instance of the GcBitmap class. |
GcBitmap(uint[], int, int, bool, bool, float, float) | Initializes a new instance of the GcBitmap class and sets the existing pixel data to be read/modified in-place. |
Name | Description |
---|---|
DpiX | Gets the horizontal dpi of the bitmap. |
DpiY | Gets the vertical dpi of the bitmap. |
ExifProfile | Gets or sets an instance of ExifProfile with Exif metadata of the image. |
Graphics | Gets an instance of the GcBitmapGraphics class. The Graphics becomes available after executing the CreateGraphics(Color?) method. |
HasImage | Gets a value indicating whether the underlying image exists (has been loaded or created). If this property is false, call Load() or CreateImage() to load or create the underlying image. Calling any other method will throw an exception unless this property is true. |
Height | Gets the height of the image, in DIPs. |
IccProfileData | Gets or sets the raw ICC profile data. |
IsDisposed | Gets a value indicating whether the GcBitmap has been disposed of. |
this[int, int] | Gets or sets a pixel color value at the specified coordinates. |
Opaque | Gets or sets a value indicating whether the alpha channel of the image should be ignored. |
PixelHeight | Gets the pixel height of the image. |
PixelWidth | Gets the pixel width of the image. |
Premultiplied | Gets or sets a value indicating if the color channels for all pixels are premultiplied by the alpha channel. Setting this property doesn't perform actual conversion. |
RawData | Gets a pointer to the internal binary data. |
Renderer | Gets an instance of the BitmapRenderer class. The renderer becomes available after executing the EnsureRendererCreated() method. |
Rotation | Gets the flip and rotate transformations that must be applied to the image. |
StoreInTempFile | Gets or sets a value indicating whether pixel data should be dynamically mapped to a temporary file rather than kept fully in memory. Setting this property to true frees up memory but slows down operations on pixel data. Do not activate this mode for small images (less than 100 x 100 pixels). The default is false. |
Width | Gets the width of the image, in DIPs. |
Name | Description |
---|---|
AddGlow(Color?, Color, float, int, int) | Creates a new bitmap by adding a glow to text and graphics on the current image. The glow effect inflates all non-transparent areas of an image by a specified amount, then applies a Gaussian blur to make the border smooth. The glow shows only where the pixels of the current image are transparent or semi-transparent. |
AddShadow(int, int, Color?, Color, float, int) | Creates a new bitmap by adding a shadow to text and graphics on the current image. The shadow shows only where the pixels of the current image are transparent or semi-transparent. |
AdjustLevels(Color, Color, Color, Color, float) | Adjusts the levels of an image histogram. The method maps the input range of values (blackPoint..whitePoint) to the output range (outputBlack..outputWhite) using the specified gamma correction (midtone). |
AdjustLevels(uint, uint, uint, uint, float) | Adjusts the levels of an image histogram. The method maps the input range of values (blackPoint..whitePoint) to the output range (outputBlack..outputWhite) using the specified gamma correction (midtone). |
AlphaBlend(GcBitmap, int, int, Rectangle?, float, int, int, int, int) | Draws the source bitmap with the specified opacity into the current bitmap. |
ApplyColorMatrix(ColorMatrix5x4, Rectangle?) | Multiplies RGBA values of the GcBitmap by a 5x4 matrix. |
ApplyEffect(BaseInplaceEffect, Rectangle?) | Applies a graphic effect to an image or its portion in-place. |
ApplyLicenseKey(string) | Applies a license key to an instance of GcBitmap. |
ApplySoftEdges(Color?, int, int) | Applies a soft edges effect to the current image. The soft edges effect deflates all non-transparent areas of an image by a specified amount, then applies a Gaussian blur to make the border smooth. |
ApplyTransparencyMask(BilevelBitmap, Rectangle?) | Applies a transparency mask to the current image or its portion. |
ApplyTransparencyMask(GrayscaleBitmap, Rectangle?) | Applies a transparency mask to the current image or its portion. |
AutoLevel(bool, float, float) | Modifies R, G, B color intensities such that the maximum range of values (0..255) is fully covered. |
BitBlt(GcBitmap, int, int, Rectangle?, int, int, int, int) | Performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source bitmap into the current bitmap. |
CalculateOtsuThreshold(Rectangle?) | Calculates Otsu's threshold [0..255] for a grayscale image. It is expected that the image is already converted to monochromatic gray. |
Clear(Color, Rectangle?) | Clears the GcBitmap with the specified color. |
Clear(uint, Rectangle?) | Clears the GcBitmap with the specified color. |
Clip(Rectangle, bool) | Creates a new GcBitmap with a fragment of the image. |
Clone(GcBitmap, bool, bool) | Copies the image into an existing GcBitmap. |
Clone(bool, bool) | Creates a new GcBitmap with a copy of the image. |
CompositeAndBlend(GcBitmap, int, int, CompositeMode, BlendMode, Rectangle?, int, int, int, int) | Applies the algorithms of Porter Duff compositing and blending to the current bitmap (used as backdrop, destination) and the source bitmap. |
ConvertFromPremultipliedAlpha() | Makes the alpha channel not premultiplied in the color channels and sets the Premultiplied property to False. |
ConvertFromPremultipliedAlpha(Rectangle) | Makes the alpha channel of the specified rectangle not premultiplied in the color channels. The Premultiplied property is not affected by this overload. |
ConvertToOpaque(Color) | Converts an image with transparent or semitransparent pixels to fully opaque with specified background color. |
ConvertToOpaque(Color, Rectangle) | Converts a part of semitransparent image to opaque with specified background color. |
ConvertToPremultipliedAlpha() | Premultiplies the color channels by the alpha channel and sets the Premultiplied property to True. |
ConvertToPremultipliedAlpha(Rectangle) | Premultiplies the color channels of the specified rectangle by the alpha channel. The Premultiplied property is not affected by this overload. |
CreateGraphics(Color?) | Creates an instance of the GcBitmapGraphics class. |
CreateImage(int, int, bool, float, float) | Creates the image of the given size and resolution. The content is not initialized and can contain any random data. If subsequent rendering is going to cover the whole surface of the bitmap, or if CreateGraphics(Color?) will be called on the bitmap with a non-null background color, clearing it (which is a lengthy operation for large bitmaps) is not needed. If some areas of the bitmap are going to be left untouched, they must be cleared to avoid the possibility of random artifacts showing. |
CreateImage(IntPtr, int, int, bool, bool, float, float) | Creates the image based on the existing pixel data to be read/modified in-place. |
CreateImage(uint[], int, int, bool, bool, float, float) | Creates the image based on the existing pixel data to be read/modified in-place. |
DiscardImage() | Releases the internal image and clears all metadata. |
Dispose() | Clean up any resources being used. |
Dispose(bool) | Performs cleanup operations on managed and unmanaged resources. |
EnsureRendererCreated() | Creates a BitmapRenderer that allows drawing on the GcBitmap if it has not been created yet. |
ExportColorChannel(GrayscaleBitmap, ColorChannel) | Copies data from one color channel of the current GcBitmap to an existing GrayscaleBitmap of the same pixel size. |
ExtractColors(Rectangle?) | Creates a sorted array of unique colors for the current image. |
FlipRotate(FlipRotateAction, Rectangle?) | Produces a flipped (horizontal or vertical) and/or rotated (by 90 degree increments) bitmap. The source bitmap remains unchanged. |
GenerateOctreePalette(int, bool) | Generates a palette for the image using the Octree quantizer algorithm. The Alpha color channel is ignored. |
GetContentRect(Color) | Returns the coordinates of a rectangle with colors different from background. |
GetContentRect(uint) | Returns the coordinates of a rectangle with colors different from background. |
HasTransparentPixels(Rectangle?) | Determines whether the image contains transparent or semitransparent pixels. It always returns false for an opaque image. |
ImportColorChannel(GrayscaleBitmap, ColorChannel) | Copies data from a GrayscaleBitmap to one color channel of the current GcBitmap of the same pixel size. |
IsBlackAndWhite() | Determines whether the image contains only black and white pixels. |
IsGrayscale() | Determines whether the image contains only opaque grayscale pixels. |
Load(byte[], int, Rectangle?) | Loads the image from a byte array. JPEG, PNG, WEBP, GIF, BMP, TIFF, ICO, JPEG 2000 formats are supported. |
Load(Stream, int, Rectangle?) | Loads the image from a stream. JPEG, PNG, WEBP, GIF, BMP, TIFF, ICO, JPEG 2000 formats are supported. |
Load(string, int, Rectangle?) | Loads the image from a file. JPEG, PNG, WEBP, GIF, BMP, TIFF, ICO, JPEG 2000 formats are supported. |
MergePalettes(int, params uint[][]) | Merges sorted arrays of unique colors in 32-bit ARGB format (returned from ExtractColors(Rectangle?)) |
Resize(int, int, InterpolationMode, Rectangle?) | Creates a new GcBitmap with a resized image fragment. |
SaveAsBmp(Stream, Rectangle?) | Saves the image into a Stream in BMP format. |
SaveAsBmp(string, Rectangle?) | Saves the image into a file in BMP format. |
SaveAsGif(Stream, Rectangle?) | Saves the image into a Stream in GIF format. |
SaveAsGif(string, Rectangle?) | Saves the image into a file in GIF format. |
SaveAsIco(Stream, Rectangle?, IcoFrameEncoding) | Saves the image into a Stream in ICO format. |
SaveAsIco(string, Rectangle?, IcoFrameEncoding) | Saves the image into a file in ICO format. |
SaveAsJpeg(Stream, Rectangle?, int) | Saves the image into a Stream in JPEG format with specified quality (from 0 to 100). |
SaveAsJpeg(string, Rectangle?, int) | Saves the image to a file in JPEG format with specified quality (from 0 to 100). |
SaveAsPng(Stream, Rectangle?) | Saves the image into a Stream in PNG format. |
SaveAsPng(string, Rectangle?) | Saves the image into a file in PNG format. |
SaveAsTiff(Stream, Rectangle?, TiffFrameSettings) | Saves the image into a Stream in TIFF format. |
SaveAsTiff(string, Rectangle?, TiffFrameSettings) | Saves the image into a file in TIFF format. |
SaveAsWebp(Stream, Rectangle?, bool, int, int) | Saves the image into a Stream in WEBP format. |
SaveAsWebp(string, Rectangle?, bool, int, int) | Saves the image to a file in WEBP format. |
SetAlphaTo255(Rectangle?) | Updates the alpha channel of pixels to 255 (to make them opaque). |
SetDpi(float) | Changes the physical resolution of the image. |
SetDpi(float, float) | Changes the physical resolution of the image. |
SetLicenseKey(string) | Sets the license key. |
ShrinkARGBFormat(int, DitheringMethod) | Changes pixel format from 8 bits per channel to lower values with two-dimensional error diffusion. |
ShrinkARGBFormat(int, int, int, int, DitheringMethod) | Changes pixel format from 8 bits per channel to lower values with two-dimensional error diffusion. |
ToBilevelBitmap(ColorChannel, bool, bool) | Creates a BilevelBitmap from the current GcBitmap. This method does not perform any transformations of the color palette. It is expected that the source GcBitmap has already been converted to bi-level palette using some thresholding or dithering effects. The ToBilevelBitmap(ColorChannel, bool, bool) method just copies data from a specified color channel to a new instance of the BilevelBitmap class. |
ToGrayscaleBitmap(ColorChannel, bool) | Creates a GrayscaleBitmap from the current GcBitmap. This method does not perform any transformations of the color palette. It is expected that the source GcBitmap has already been converted to grayscale palette using a GrayscaleEffect or something like that. Alternatively, you can use this method to extract individual channels of a color image without any prior conversion, and treat the resulting GrayscaleBitmap simply as a representation of some image data with 8 bits per pixel. The ToGrayscaleBitmap(ColorChannel, bool) method just copies data from a specified color channel to a new instance of the GrayscaleBitmap class. If you need to copy some color channel to an existing instance of GrayscaleBitmap, use the ExportColorChannel(GrayscaleBitmap, ColorChannel) method instead. |
ToIndexed4bppBitmap(DitheringMethod, bool) | Creates an Indexed4bppBitmap from the current image. |
ToIndexed4bppBitmap(int, bool, bool) | Creates an opaque Indexed4bppBitmap from the current image using the Octree quantizer algorithm. |
ToIndexed4bppBitmap(uint[], DitheringMethod, bool, bool) | Creates an opaque Indexed4bppBitmap from the current image using the specified palette. |
ToIndexed8bppBitmap(DitheringMethod) | Creates an Indexed8bppBitmap from the current image. |
ToIndexed8bppBitmap(int, bool) | Creates an opaque Indexed8bppBitmap from the current image using the Octree quantizer algorithm. |
ToIndexed8bppBitmap(uint[], DitheringMethod, bool) | Creates an opaque Indexed8bppBitmap from the current image using the specified palette. |
ToJpegStream(int) | Saves the image into a Stream in JPEG format with specified quality (from 0 to 100). The returned stream should be disposed after usage. |