-
Notifications
You must be signed in to change notification settings - Fork 18
pyui.create_image
Creates a borderless static image control. The displayed image is assigned with set_control_icon and is automatically scaled to match the current display scaling (DPI) of the dialog. The control is purely decorative: it has no border, no text and no event handlers.
pyui.create_image(dialog, col_spec)
dialog:create_image(col_spec)| Type | Description | |
|---|---|---|
dialog |
dialog_handle |
Dialog where the control is created |
col_spec |
integer or {first, last}
|
Index of the column or specification of the column-span, where the control is placed. |
| Type | Description |
|---|---|
control_handle |
A handle to the newly created control |
Assign the image directly after creating the control with set_control_icon — the icon (and its optional size) determines the measured size of the control. Without an assigned icon the control reserves the default icon size (16 px at 100 % scaling).
The image is centered inside the layout cell. Use the same icon-file conventions as for button icons: a multi-resolution .ico, or a set of png files at different resolutions.
local image = dialog:create_image(1)
image:set_control_icon({
pyio.get_plugin_folder_path("icons/logo_32.png"),
pyio.get_plugin_folder_path("icons/logo_64.png"),
pyio.get_plugin_folder_path("icons/logo_128.png"),
}, {size = 64})Minimum PYTHA Version: V27
The function is absent (nil) in older versions, so a plugin can probe for it with if pyui.create_image then ... end.
Control Gallery, set_control_icon, create_label, create_thumbnail_preview