Click or drag to resize
CfxImage Class

[This is preliminary documentation and is subject to change.]

Container for a single image represented at different scale factors. All image representations should be the same size in density independent pixel (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels then the image at scale factor 2.0 should be 200x200 pixels -- both images will display with a DIP size of 100x100 units. The functions of this structure must be called on the browser process UI thread.
Inheritance Hierarchy
SystemObject
  ChromiumCfxObject
    ChromiumCfxBase
      ChromiumCfxLibraryBase
        ChromiumCfxImage

Namespace: Chromium
Assembly: ChromiumFX (in ChromiumFX.dll)
Syntax
public class CfxImage : CfxLibraryBase

The CfxImage type exposes the following members.

Properties
  NameDescription
Public propertyHeight
Returns the image height in density independent pixel (DIP) units.
Public propertyIsEmpty
Returns true (1) if this Image is NULL.
Public propertyNativePtr
Provides access to the underlying native cef struct. This is a refcounted library struct derived from cef_base_t. Add a ref in order to keep it alive when this managed object go out of scope.
(Inherited from CfxLibraryBase.)
Public propertyWidth
Returns the image width in density independent pixel (DIP) units.
Top
Methods
  NameDescription
Public methodAddBitmap
Add a bitmap image representation for |scaleFactor|. Only 32-bit RGBA/BGRA formats are supported. |pixelWidth| and |pixelHeight| are the bitmap representation size in pixel coordinates. |pixelData| is the array of pixel data and should be |pixelWidth| x |pixelHeight| x 4 bytes in size. |colorType| and |alphaType| values specify the pixel format.
Public methodAddJpeg
Create a JPEG image representation for |scaleFactor|. |jpegData| is the image data of size |jpegDataSize|. The JPEG format does not support transparency so the alpha byte will be set to 0xFF for all pixels.
Public methodAddPng
Add a PNG image representation for |scaleFactor|. |pngData| is the image data of size |pngDataSize|. Any alpha transparency in the PNG data will be maintained.
Public methodStatic memberCreate
Create a new CfxImage. It will initially be NULL. Use the Add*() functions to add representations at different scale factors.
Public methodGetAsBitmap
Returns the bitmap representation that most closely matches |scaleFactor|. Only 32-bit RGBA/BGRA formats are supported. |colorType| and |alphaType| values specify the desired output pixel format. |pixelWidth| and |pixelHeight| are the output representation size in pixel coordinates. Returns a CfxBinaryValue containing the pixel data on success or NULL on failure.
Public methodGetAsJpeg
Returns the JPEG representation that most closely matches |scaleFactor|. |quality| determines the compression level with 0 == lowest and 100 == highest. The JPEG format does not support alpha transparency and the alpha channel, if any, will be discarded. |pixelWidth| and |pixelHeight| are the output representation size in pixel coordinates. Returns a CfxBinaryValue containing the JPEG image data on success or NULL on failure.
Public methodGetAsPng
Returns the PNG representation that most closely matches |scaleFactor|. If |withTransparency| is true (1) any alpha transparency in the image will be represented in the resulting PNG data. |pixelWidth| and |pixelHeight| are the output representation size in pixel coordinates. Returns a CfxBinaryValue containing the PNG image data on success or NULL on failure.
Public methodGetRepresentationInfo
Returns information for the representation that most closely matches |scaleFactor|. |actualScaleFactor| is the actual scale factor for the representation. |pixelWidth| and |pixelHeight| are the representation size in pixel coordinates. Returns true (1) on success.
Public methodHasRepresentation
Returns true (1) if this image contains a representation for |scaleFactor|.
Public methodIsSame
Returns true (1) if this Image and |that| Image share the same underlying storage. Will also return true (1) if both images are NULL.
Public methodRemoveRepresentation
Removes the representation for |scaleFactor|. Returns true (1) on success.
Top
Remarks
See also the original CEF documentation in cef/include/capi/cef_image_capi.h.
See Also