Canvas drawing and retina

I’m redoing elements of my TabBar control for a project - finally getting around to sorting out the drawing!

As you can see from the attached image - the text and arrows don’t seem to be very nice on a retina device.

I’m not doing anything code wise to handle retina - I’m just doing drawing from the graphics class.

' Draw the tab title g.ForeColor = If (Tab.Active, kActiveTabFontColour, kFontColour) g.DrawString(tab.Title, TabStartPoint + ((TabWidth / 2) - (StringWidth / 2)), 20)

  • and -

' Right Arrow g.ForeColor = If (RightButtonPressed, kButtonPressedColour, kFontColour) g.DrawLine(me.Width - 20, 10, me.Width - 10, 26 / 2) g.DrawLine(me.Width - 20, 26 - 10, me.Width - 10, 13)

Any suggestions to improve matters would be gratefully accepted??

Looks like you need to enable Retina in the app…

Paste this in a text file:

[code]<?xml version="1.0" encoding="UTF-8"?>

NSHighResolutionCapable [/code]

Name it info.plist and drag it in to the project.

Oh - pretty stupid!
I have a build step to enable retina but never copied it to the test app!!!

Thanks Jim

Does that automatically enable Retina response for all things “drawn”
Text, drawline, drawrect etc… etc…
The only thing it DOESN’t do is handle switch @2X images??

If so, why doesn’t XOJO just make that a default entry for OSX?

Well here’s the after shot…

Just add this to a post build step

Dim App As String = CurrentBuildLocation + "/""" + CurrentBuildAppName + ".app""" Call DoShellCommand("/usr/bin/defaults write " + App + "/Contents/Info ""NSHighResolutionCapable"" YES")

[quote=199583:@Dave S]Does that automatically enable Retina response for all things “drawn”
Text, drawline, drawrect etc… etc…
The only thing it DOESN’t do is handle switch @2X images??

If so, why doesn’t XOJO just make that a default entry for OSX?[/quote]
I believe I recall something about Xojo not being officially retina compatible, and they didn’t want to enable the option until it was.