image
Display images. Currently, the following formats are allowed:
jpg
png
Please make sure the image address exists before use. Use the dep
built-in function to point to the image address. This function can use an absolute address. In the following example, crate://self/
represents the project root directory.
Name | Description | Type |
---|---|---|
visible | Visible or not | bool |
grab_key_focus | Capture keyboard focus | bool |
opacity | Opacity | F32 |
cursor | Mouse pointer style | MouseCursor |
scale | Scale ratio | F64 |
fit | Image fit method | ImageFit |
src | Image resource path | LiveDependency |
min_width | Minimum width | i64 |
min_height | Minimum height | i64 |
rotation | Rotation angle | F32 |
abs_pos | Absolute position | DVec2 |
margin | Margin | Margin |
width | width | Size |
height | height | Size |
scroll | scroll offset | DVec2 |
clip_x | clip X axis or not | bool |
clip_y | clip Y axis or not | bool |
padding | padding | Padding |
align | alignment | Align |
flow | flow mode | Flow |
spacing | spacing | F64 |
event_key | event key | bool |
name | description | parameters |
---|---|---|
hover_in | mouse hover event | GImageHoverParam |
hover_out | Mouse over event | GImageHoverParam |
clicked | Click event | GImageClickedParam |