# Interface ICefImage

Description
Hierarchy
Fields
Methods
Properties

## Unit

uCEFInterfaces

## Declaration

`type ICefImage = interface(ICefBaseRefCounted)`

## Description

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 interface can be called on any browser process thread.

UNKNOWN

<see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_image_capi.h">CEF source file: /include/capi/cef_image_capi.h (cef_image_t))

## Hierarchy

- IInterface
- ICefBaseRefCounted
- ICefImage

## Overview

### Methods

| `function IsEmpty: Boolean;`
| `function IsSame(const that: ICefImage): Boolean;`
| `function AddBitmap(scaleFactor: Single; pixelWidth, pixelHeight: Integer; colorType: TCefColorType; alphaType: TCefAlphaType; const pixelData: Pointer; pixelDataSize: NativeUInt): Boolean;`
| `function AddPng(scaleFactor: Single; const pngData: Pointer; pngDataSize: NativeUInt): Boolean;`
| `function AddJpeg(scaleFactor: Single; const jpegData: Pointer; jpegDataSize: NativeUInt): Boolean;`
| `function GetWidth: NativeUInt;`
| `function GetHeight: NativeUInt;`
| `function HasRepresentation(scaleFactor: Single): Boolean;`
| `function RemoveRepresentation(scaleFactor: Single): Boolean;`
| `function GetRepresentationInfo(scaleFactor: Single; var actualScaleFactor: Single; var pixelWidth, pixelHeight: Integer): Boolean;`
| `function GetAsBitmap(scaleFactor: Single; colorType: TCefColorType; alphaType: TCefAlphaType; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;`
| `function GetAsPng(scaleFactor: Single; withTransparency: Boolean; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;`
| `function GetAsJpeg(scaleFactor: Single; quality: Integer; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;`

### Properties

| `property Width : NativeUInt read GetWidth;`
| `property Height : NativeUInt read GetHeight;`

## Description

### Methods

| `function IsEmpty: Boolean;`

Returns true (1) if this Image is NULL.

###### Attributes

GUID['{E2C2F424-26A2-4498-BB45-DA23219831BE}']

| `function IsSame(const that: ICefImage): Boolean;`
Returns true (1) if this Image and |that| Image share the same underlying storage. Will also return true (1) if both images are NULL.

| `function AddBitmap(scaleFactor: Single; pixelWidth, pixelHeight: Integer; colorType: TCefColorType; alphaType: TCefAlphaType; const pixelData: Pointer; pixelDataSize: NativeUInt): Boolean;`
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.

| `function AddPng(scaleFactor: Single; const pngData: Pointer; pngDataSize: NativeUInt): Boolean;`
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.

| `function AddJpeg(scaleFactor: Single; const jpegData: Pointer; jpegDataSize: NativeUInt): Boolean;`
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.

| `function GetWidth: NativeUInt;`
Returns the image width in density independent pixel (DIP) units.

| `function GetHeight: NativeUInt;`
Returns the image height in density independent pixel (DIP) units.

| `function HasRepresentation(scaleFactor: Single): Boolean;`
Returns true (1) if this image contains a representation for |scale_factor|.

| `function RemoveRepresentation(scaleFactor: Single): Boolean;`
Removes the representation for |scale_factor|. Returns true (1) on success.

| `function GetRepresentationInfo(scaleFactor: Single; var actualScaleFactor: Single; var pixelWidth, pixelHeight: Integer): Boolean;`
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 (1) on success.

| `function GetAsBitmap(scaleFactor: Single; colorType: TCefColorType; alphaType: TCefAlphaType; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;`
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 ICefBinaryValue containing the pixel data on success or NULL on failure.

| `function GetAsPng(scaleFactor: Single; withTransparency: Boolean; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;`
Returns the PNG representation that most closely matches |scale_factor|. If |with_transparency| is true (1) 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 ICefBinaryValue containing the PNG image data on success or NULL on failure.

| `function GetAsJpeg(scaleFactor: Single; quality: Integer; var pixelWidth, pixelHeight: Integer): ICefBinaryValue;`

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 ICefBinaryValue containing the JPEG image data on success or NULL on failure.

### Properties

| `property Width : NativeUInt read GetWidth;`
Returns the image width in density independent pixel (DIP) units.

| `property Height : NativeUInt read GetHeight;`
Returns the image height in density independent pixel (DIP) units.

Generated by PasDoc 0.17.0.snapshot.