Image

From HTML5 Builder
Jump to: navigation, search

The Image component renders an image.

Configuration

In order to get the Image working you only need to give a proper value to its ImageSource property.

Usage

Base64

Encode

You can encode your Image (Image1) as base64 like this:

// Gather needed data from the control:
$path = $this->Image1->ImageSource;
$filetype = $this->Image1->BinaryType;

// Open the image:
$file = fread(fopen($path, "r"), filesize($path));

// Encode it:
$base64 = 'data:' . $filetype . ';base64,' . base64_encode($file);

Display

You can enter a base64-encoded image code directly into Image’s ImageSource property. If yours does not seem to work, you can try with this one.

Client-side Features

DOM Elements

The component generates the following client-side DOM elements:

  • Wrapper (HTMLDivElement). Full web browser support. Access it with $("#ComponentName_outer").get()[0].
    • Main element (HTMLImageElement). Full web browser support. Access it with: $("#ComponentName").get()[0].

Client-side Events

Documented in the RPCL Reference.

Server-side Features

Properties, Methods and Events

Documented in the RPCL Reference.

Help Resources

Documentation

See Also

  • Alternatives: MImage (mobile applications).
  • Related components: MapShape.