Hi!
I have a Macbook Pro Retina Touchbar. I made sure the screen is set to Default.
This is what I have found so far. I’m using wxPython 3.0.1.0 (although I’ve tried to use the 4.0 version as well). Below is a sample script I wrote (requires AppKit PyObjC to check for backingScaleFactor). I made sure to look at the backingScaleFactor and found it correctly it returns 2. I’m looking at the bitmap code block and do see support:
if ( type == wxBITMAP_TYPE_PNG )
{
if ( wxOSXGetMainScreenContentScaleFactor() > 1.9 )
{
wxFileName fn(filename);
fn.MakeAbsolute();
fn.SetName(fn.GetName()+“@2x”);
if ( fn.Exists() )
{
fname = fn.GetFullPath();
scale = 2.0;
}
}
}
I just have no idea why its not working. Here is the sample:
import AppKit as AK
import wx
class MyFrame(wx.Frame):
def init(self, parent):
wx.Frame.init(self, parent, -1, “Retina Demo”)
print AK.NSScreen.screens()[0].backingScaleFactor()
path = “img.png”
bmp = wx.EmptyBitmap( 1, 1 )
bmp.LoadFile(path, wx.BITMAP_TYPE_PNG)
bmp = wx.StaticBitmap(self, -1, bmp)
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(bmp, 1, wx.ALL|wx.EXPAND, 5)
self.SetSizer(sizer)
sizer.Fit(self)
self.Layout()
app = wx.App()
frame = MyFrame(None)
app.SetTopWindow(frame)
frame.Show()
app.MainLoop()
···
On Mon, May 22, 2017 at 12:20 PM, Igor Korot ikorot01@gmail.com wrote:
Hi,
On Mon, May 22, 2017 at 3:13 PM, Rishi Sharma rishsharma@gmail.com wrote:
Hi everyone,
I understand wxPython has support for retina text, but no matter what I do I
cannot get retina support working for images.
Does anyone have an idea on how to get it to work if possible? Do I need to
patch wxWidgets and rebuild wxPython? Whats the least version that supports
retina?
If anyone has a sample demo script that works I’d appreciate an example.
What is your {wx}python versions?
What OSX version?
Are you sure you have a Retina display?
Thank you.
Thanks,
-R
–
You received this message because you are subscribed to the Google Groups
“wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.