Replies: 4 comments 1 reply
-
Haha, I forgot to scale down my images prior to giving them to canvas.NewImageFromImage. No wonder it was slow and janky. Sorry for the chatter, I think I'm on the right path again using widget.GridWrap. |
Beta Was this translation helpful? Give feedback.
-
Er, well to clarify a little, I was using canvas.NewImageFromFile -- but obvioiusly that doesn't do any pre-scaling so switched to opening and decoding the image not-with-Fyne, scaling it, and then handing it over to Fyne's canvas.NewImageFromImage. Maybe adding a pre-scaling option to canvas.NewImageFromFile would be useful? Or maybe a doc note? |
Beta Was this translation helpful? Give feedback.
-
The canvas primitives don't do smart things - they are used for the low-level rendering work. |
Beta Was this translation helpful? Give feedback.
-
Above I was just thinking about how to maybe help the next person that comes along and falls into the same trap. But I can't think of a clean way to really help here, each person will just have to work through it. Maybe a canvas.Image.Resize()? Then again I've noticed other scaling algorithms (like from github.com/disintegration/imaging) look better and I don't think Fyne should become an image processing platform. :) So... just not a big deal, but I'd popped this discussion before I realized my issue. |
Beta Was this translation helpful? Give feedback.
-
I've been plugging away at ideas on how to do this, but all my protoypes are horribly slow and janky.
My latest attempt was to use the widget.GridWrap and make a custom Thumbnail widget with an underlying canvas.Image. That "worked" in that it displayed, but it was super slow scrolling and I think the focus / selection behavior was just horrible. As I move the mouse, the focus hover color change flickers and flashes madly, and when I select an item, it does it but only after flickering and spazing for a bit.
I've also tried using container.GridWrap inside a container/widget.Scroll and while that is nice and fast, I have no idea how to scroll to a thumbnail so it is shown on the screen -- there is just scroll to top / bottom options.
I also looked at Cards, but I'm not sure what those are really tailored for.
Beta Was this translation helpful? Give feedback.
All reactions