[]
        
(Showing Draft Content)

GrapeCity.Documents.Imaging.Windows.GcWicBitmap

GcWicBitmap Class

Represents a bitmap based on Windows Imaging Component.

Inheritance
GcWicBitmap
Implements
Namespace: GrapeCity.Documents.Imaging.Windows
Assembly: DS.Documents.Imaging.Windows.dll
Syntax
public class GcWicBitmap : IImage, IDisposable
Public Class GcWicBitmap
    Implements IImage, IDisposable

Constructors

Name Description
GcWicBitmap()

Initializes an instance of the GcWicBitmap class.

GcWicBitmap(ImagingFactory)

Initializes a new instance of the GcWicBitmap class.

GcWicBitmap(Image, Rectangle?)

Initializes a new instance of the GcWicBitmap class.

GcWicBitmap(GcBitmap, ImagingFactory)

Initializes a new instance of the GcWicBitmap class from an instance of GcBitmap.

If the source image is not opaque, the color channels must be premultiplied with the alpha channel.

GcWicBitmap(byte[], int, Rectangle?)

Initializes a new instance of the GcWicBitmap class.

GcWicBitmap(Stream, int, Rectangle?)

Initializes a new instance of the GcWicBitmap class.

GcWicBitmap(int, int, bool, float, float)

Initializes a new instance of the GcWicBitmap class and creates the image.

The image content is not initialized and can contain any random data.

GcWicBitmap(string, int, Rectangle?)

Initializes a new instance of the GcWicBitmap class.

Properties

Name Description
Brush

Gets an instance of the GrapeCity.Documents.DX.Direct2D.SolidColorBrush class.

The brush becomes available after executing the EnsureRenderTargetCreated() method.

D2DFactory

Gets an instance of the GrapeCity.Documents.DX.Direct2D.Factory1 class.

The factory becomes available after executing the EnsureRenderTargetCreated() method.

DWFactory

Gets an instance of the GrapeCity.Documents.DX.DirectWrite.Factory1 class.

The factory becomes available after initializing the font cache (see the SetFontCache(FontCache) method).

DpiX

Gets the x-axis dpi resolution.

DpiY

Gets the y-axis dpi resolution.

Graphics

Gets an instance of the GcWicBitmapGraphics class.

The Graphics becomes available after executing the CreateGraphics(Color?) method.

GraphicsSupported

Gets a value indicating if GcWicBitmap supports the CreateGraphics(Color?) method on the current platform.

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.

ImagingFactory

Gets an instance of the GrapeCity.Documents.DX.WIC.ImagingFactory class.

IsDisposed

Gets a value indicating whether the GcWicBitmap has been disposed of.

IsSupported

Gets a value indicating if GcWicBitmap is available on the current platform.

Make sure that "Thread.CurrentThread.SetApartmentState(ApartmentState.MTA)" is executed at the beginning of the Program.Main() method.

NativeBitmap

Gets the internal image that is an IWICBitmap.

PixelFormat

Gets the pixel format of the image.

PixelHeight

Gets the pixel height of the image.

PixelWidth

Gets the pixel width of the image.

RenderTarget

Gets an instance of the GrapeCity.Documents.DX.Direct2D.RenderTarget class.

The render target becomes available after executing the EnsureRenderTargetCreated() method.

Width

Gets the width of the image, in DIPs.

Methods

Name Description
ApplyLicenseKey(string)

Applies a license key to an instance of GcWicBitmap.

BitsPerPixel(WicPixelFormat)

Returns the number of bits-per-pixel (bpp) for the given value of the PixelFormat enumeration.

CanConvertTo(WicPixelFormat)

Determines if the current pixel format can be converted to the destination pixel format.

CreateGraphics(Color?)

Creates an instance of the GcWicBitmapGraphics 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.

CreatePaletteFromBitmap(int, bool)

Creates a palette using a computed optimized values based on the bitmap.

CreatePredefinedPalette(WicPaletteType, bool)

Creates one of the pre-defined palettes specified by PaletteType and optionally adds a transparent color.

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.

EnsureRenderTargetCreated()

Creates a render target for the internal WIC image, if it has not been created yet.

ExportFragment(GcBitmap, int, int, Rectangle)

Copies a fragment of the image to the specified GcBitmap object.

ExportFragment(IntPtr, Rectangle)

Copies a fragment of the image to the unmanaged block of memory.

GetImageStride()

Returns the image stride (bytes per row).

GetPalette()

Retrieves the color table for indexed pixel formats, or null for other formats.

Import(GcBitmap)

Loads the image from an instance of the GcBitmap class.

If the source image is not opaque, the color channels must be premultiplied with the alpha channel.

Import(GcWicBitmap)

Loads the image from another instance of GcWicBitmap.

Import(byte[], int, int, WicPixelFormat)

Loads the image from a byte array containing the pixels buffer.

Import(byte[], int, int, int, WicPixelFormat)

Loads the image from a byte array containing the pixels buffer with specified stride (bytes per row of pixels).

Import(IntPtr, int, int, WicPixelFormat)

Loads the image from the unmanaged block of memory pointed by IntPtr.

Import(IntPtr, int, int, int, WicPixelFormat)

Loads the image from a unmanaged block of memory pointed by IntPtr and having the specified stride (bytes per row of pixels).

ImportAsFragment(GcBitmap, int, int)

Loads a GcBitmap at the given destination within the image.

If the source image is not opaque, the color channels must be premultiplied with the alpha channel.

ImportAsFragment(GcWicBitmap, int, int)

Loads another GcWicBitmap at the given destination within the image.

ImportAsFragment(byte[], Rectangle)

Loads the pixel buffer from a byte array at the given destination within the image.

ImportAsFragment(IntPtr, Rectangle)

Copies the unmanaged block of memory ato the given destination within the image.

Load(Stream, params BaseTransform[])

Loads the image from a System.IO.Stream. JPEG, PNG, GIF, BMP, TIFF, ICO, JPEG XR formats are supported.

Load(Stream, WicContainerFormat, int, Rectangle?, params BaseTransform[])

Loads the image from a System.IO.Stream. JPEG, PNG, GIF, BMP, TIFF, ICO, JPEG XR formats are supported.

Load(string, params BaseTransform[])

Loads the image from a file. JPEG, PNG, GIF, BMP, TIFF, ICO, JPEG XR formats are supported.

Load(string, WicContainerFormat, int, Rectangle?, params BaseTransform[])

Loads the image from a file. JPEG, PNG, GIF, BMP, TIFF, ICO, JPEG XR formats are supported.

PixelFormatFromGuid(Guid)

Converts a GUID of the WIC pixel format to the PixelFormat enumeration value.

PixelFormatToGuid(WicPixelFormat)

Returns a GUID of the corresponding WIC pixel format for the given value of the PixelFormat enumeration.

Save(Stream, WicContainerFormat, BaseOptions)

Saves the image to a System.IO.Stream using the specified format and options.

Save(string, WicContainerFormat, BaseOptions)

Saves the image to a file using the specified format and options.

SaveAsBmp(Stream, BmpOptions)

Saves the image to a System.IO.Stream in BMP format.

SaveAsBmp(string, BmpOptions)

Saves the image to a file in BMP format.

SaveAsGif(Stream, GifOptions)

Saves the image to a System.IO.Stream in GIF format.

SaveAsGif(string, GifOptions)

Saves the image to a file in GIF format.

SaveAsJpeg(Stream, JpegOptions)

Saves the image to a System.IO.Stream in JPEG format.

SaveAsJpeg(string, JpegOptions)

Saves the image to a file in JPEG format.

SaveAsJpegXR(Stream, JpegXROptions)

Saves the image to a System.IO.Stream in JPEG XR format.

SaveAsJpegXR(string, JpegXROptions)

Saves the image to a file in JPEG XR format.

SaveAsPng(Stream, PngOptions)

Saves the image to a System.IO.Stream in PNG format.

SaveAsPng(string, PngOptions)

Saves the image to a file in PNG format.

SaveAsTiff(Stream, TiffOptions)

Saves the image to a System.IO.Stream in TIFF format.

SaveAsTiff(string, TiffOptions)

Saves the image to a file in TIFF format.

SetDpi(float)

Changes the physical resolution of the image.

SetDpi(float, float)

Changes the physical resolution of the image.

SetFontCache(FontCache)

Assigns a shared instance of the GrapeCity.Documents.Imaging.Windows.GcWicBitmap.FontCache object.

SetLicenseKey(string)

Sets the license key.

SetPalette(Palette)

Sets the new color table for the bitmap.

ToByteArray()

Stores the image buffer to a byte array (without the palette and metadata information).

ToByteArray(Rectangle)

Stores a rectangular area of the image to a byte array.

ToByteArray(out int)

Stores the image buffer to a byte array with the same stride (bytes per row).

ToGcBitmap(GcBitmap, bool)

Stores the image buffer into an existing instance of GcBitmap.

ToGcBitmap(bool)

Stores the image buffer to a GcBitmap.

ToGcBitmap(Rectangle, bool)

Stores a rectangular area of the image to a GcBitmap.

Transform(params BaseTransform[])

Creates a new instance of GcWicBitmap as a copy of the current bitmap passed through the set of transformations.