• References
    • Main
    • RenderKit
    • LibJS
    • Canvas
  • Components
    • Overview
    • Page
    • Basic
      • Rectangle
      • Text
      • Button
      • HTML Article
      • Toggle Button
      • Tiler
      • Web View
      • Image Zoomer
    • Navigation
      • Carousel
    • Forms
      • Form
      • Text Entry
    • Layout
      • Group
  • Web API
  • Tutorials
  • Contact
Menu
  • References
    • Main
    • RenderKit
    • LibJS
    • Canvas
  • Components
    • Overview
    • Page
    • Basic
      • Rectangle
      • Text
      • Button
      • HTML Article
      • Toggle Button
      • Tiler
      • Web View
      • Image Zoomer
    • Navigation
      • Carousel
    • Forms
      • Form
      • Text Entry
    • Layout
      • Group
  • Web API
  • Tutorials
  • Contact
Umajin Developer > Components > Image

Image

Check out the standard help for an overview of the image component.

API Examples

// Internally the component is known as "image"
var imageComponent1 = findComponent("My Page", "image", "MyImage"); // To retrieve a image component called "MyImage" on a page called "My Page"
var imageComponent2 = findComponentInForeground("My Foreground", "image", "MyImage"); // To retrieve a image component in the foreground.
var imageComponent3 = createComponent(parentComponent, "image", 0, 0, 100, 100); // to create a image component inside a custom component.
 
// Retrieving a property
var image = getProperty(imageComponent1, "filename");
console.log(image);
 
// Setting a property
setProperty(imageComponent1, "crop_mode", 1);
 
// Binding an event
bindEvent(imageComponent3, "on_press", "action");
function action(){
    console.log("hello world");
}

 

Properties

See the shared property list for all properties available for this component.

PropertyTypeDescription
filenamestringThe filename of image
crop_modenumber0 – crop
1 – fit
2 – stretch
align_xrealDefault is 0.5
align_yrealDefault is 0.5
effect_namestring
mask_filenamestring The filename of mask
native_widthstring Read Only. The original width of image
native_heightstring Read Only. The original height of image

Events

See the shared event list for all events available for this component.

  • Developer Home
  • Umajin Home
  • Support Home
Menu
  • Developer Home
  • Umajin Home
  • Support Home