roblillack / spot

React-like desktop GUI toolkit for Go
MIT License
1.11k stars 17 forks source link

Add image control #16

Closed roblillack closed 5 months ago

roblillack commented 5 months ago

This PR adds a simple, controlled ui.Image component which can be used to show any kind static or dynamic bitmap data:

&ui.Image{
    X: 10, Y: 10, Width: 300, Height: 300,
    Image: /* a Go image.Image */,
    OnClick: func(x, y int, secondary bool) {
        // ... where was the image clicked? ...
    },
},
image

Limitations: