I've been working on a wxPython image tool for and needed some alpha/drawing consistency between platforms so I've decided to switch my main drawing over to a cairo context. Everything was working okay on GTK3, which according to wx.DC.GetHandle already returns a cairo contxt, on my chromebook, but as soon as I switched to MSW everything broke. I messed around a little bit and found that the alpha channels weren't working because the cairo Surface is FORMAT_RGB24. I'm not 100% sure if that's the issue but I now that as soon as I remove the alpha from set_source_rgba -> rgb everything draws fine. According to pycairo's documentation the Win32Surface will always be a format of RGB24, but the C API does provide a create with format option (link below) that does support ARGB32. I was wondering if an extra format argument could be added to the win32surface object. Thanks.
I've been working on a wxPython image tool for and needed some alpha/drawing consistency between platforms so I've decided to switch my main drawing over to a cairo context. Everything was working okay on GTK3, which according to wx.DC.GetHandle already returns a cairo contxt, on my chromebook, but as soon as I switched to MSW everything broke. I messed around a little bit and found that the alpha channels weren't working because the cairo Surface is FORMAT_RGB24. I'm not 100% sure if that's the issue but I now that as soon as I remove the alpha from set_source_rgba -> rgb everything draws fine. According to pycairo's documentation the Win32Surface will always be a format of RGB24, but the C API does provide a create with format option (link below) that does support ARGB32. I was wondering if an extra format argument could be added to the win32surface object. Thanks.
https://www.cairographics.org/manual/cairo-Win32-Surfaces.html#cairo-win32-surface-create-with-format