MImage

From HTML5 Builder
Jump to: navigation, search

The MImage component renders an image. It can also contain MapShape components, which can be used to attach interaction to parts of the image.

Configuration

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

Usage

Base64

Encode

You can encode your MImage as base64 like this:

// Gather needed data from the control:
$path = $this->ComponentName->ImageSource;
$filetype = $this->ComponentName->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 MImage’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.

See Also

  • Alternatives: Image (web applications).