Image is a widget that renders an [image.Image]. See [styles.Style.ObjectFit] to control the image rendering within the allocated size. The default minimum requested size is the pixel size in [units.Dp] units (1/160th of an inch).
| 22 | // the allocated size. The default minimum requested size is the pixel |
| 23 | // size in [units.Dp] units (1/160th of an inch). |
| 24 | type Image struct { |
| 25 | WidgetBase |
| 26 | |
| 27 | // Image is the [image.Image]. |
| 28 | Image image.Image `xml:"-" json:"-"` |
| 29 | |
| 30 | // prevImage is the cached last [Image.Image]. |
| 31 | prevImage image.Image |
| 32 | |
| 33 | // prevRenderImage is the cached last rendered image with any transformations applied. |
| 34 | prevRenderImage image.Image |
| 35 | |
| 36 | // prevObjectFit is the cached [styles.Style.ObjectFit] of the last rendered image. |
| 37 | prevObjectFit styles.ObjectFits |
| 38 | |
| 39 | // prevSize is the cached allocated size for the last rendered image. |
| 40 | prevSize math32.Vector2 |
| 41 | } |
| 42 | |
| 43 | func (im *Image) WidgetValue() any { return &im.Image } |
| 44 |
nothing calls this directly
no outgoing calls
no test coverage detected