Click or drag to resize

CefImage Class

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 methods of this class must be called on the browser process UI thread.
Inheritance Hierarchy
SystemObject
  Internal.Xilium.CefGlueCefImage

Namespace:  Internal.Xilium.CefGlue
Assembly:  NeoAxis.Core (in NeoAxis.Core.dll) Version: 2024.1.1.0 (2024.1.1.0)
Syntax
C#
public sealed class CefImage : IDisposable

The CefImage type exposes the following members.

Properties
  NameDescription
Public propertyHeight
Returns the image height in density independent pixel (DIP) units.
Public propertyIsEmpty
Returns true if this Image is empty.
Public propertyWidth
Returns the image width in density independent pixel (DIP) units.
Top
Methods
  NameDescription
Public methodAddBitmap
Add a bitmap image representation for |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |pixel_width| and |pixel_height| are the bitmap representation size in pixel coordinates. |pixel_data| is the array of pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in size. |color_type| and |alpha_type| values specify the pixel format.
Public methodAddJpeg
Create a JPEG image representation for |scale_factor|. |jpeg_data| is the image data of size |jpeg_data_size|. 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 |scale_factor|. |png_data| is the image data of size |png_data_size|. Any alpha transparency in the PNG data will be maintained.
Public methodStatic memberCreateImage
Create a new CefImage. It will initially be empty. Use the Add*() methods to add representations at different scale factors.
Public methodDispose
Releases all resources used by the CefImage
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize (Overrides ObjectFinalize.)
Public methodGetAsBitmap
Returns the bitmap representation that most closely matches |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |color_type| and |alpha_type| values specify the desired output pixel format. |pixel_width| and |pixel_height| are the output representation size in pixel coordinates. Returns a CefBinaryValue containing the pixel data on success or NULL on failure.
Public methodGetAsJpeg
Returns the JPEG representation that most closely matches |scale_factor|. |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. |pixel_width| and |pixel_height| are the output representation size in pixel coordinates. Returns a CefBinaryValue containing the JPEG image data on success or NULL on failure.
Public methodGetAsPng
Returns the PNG representation that most closely matches |scale_factor|. If |with_transparency| is true any alpha transparency in the image will be represented in the resulting PNG data. |pixel_width| and |pixel_height| are the output representation size in pixel coordinates. Returns a CefBinaryValue containing the PNG image data on success or NULL on failure.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetRepresentationInfo
Returns information for the representation that most closely matches |scale_factor|. |actual_scale_factor| is the actual scale factor for the representation. |pixel_width| and |pixel_height| are the representation size in pixel coordinates. Returns true on success.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasRepresentation
Returns true if this image contains a representation for |scale_factor|.
Public methodIsSame
Returns true if this Image and |that| Image share the same underlying storage. Will also return true if both images are empty.
Public methodRemoveRepresentation
Removes the representation for |scale_factor|. Returns true on success.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
See Also