lxn / walk

A Windows GUI toolkit for the Go Programming Language
Other
6.79k stars 885 forks source link

Anti aliasing api support #709

Closed tky753 closed 3 years ago

tky753 commented 3 years ago

I use CustomWidget to draw step widget like this: image Is there a way for Anti-aliasing

lxn commented 3 years ago

Walk currently uses GDI, which does not support it. I would like to use Direct2D instead, but that would be a lot of work.

Maybe you could accomplish your task with some Go package like https://github.com/fogleman/gg. When I implemented graphics effects for walk, I first used that package. Sadly it was too slow for that feature to work properly, but it may work well for your use case. walk.Bitmap has some standard Go image.Image interop stuff to integrate this.

tky753 commented 3 years ago

What about GDI+

lxn commented 3 years ago

You are right, it could make sense to use GDI+ selectively for some features, at least in the shorter term. It's already used to load images after all. Needs some investigation, but I'm afraid I can't invest a lot of time into this right now.