What is the WPF equivalent of Cocoa/CSS image.png/[email protected] concept?

180 Views Asked by At

For a Mac/iOS application to support retina/high fidelity screens, additional double-resolution bitmap images need to be included with "@2x" just before the file extension. E.g.:

logo.png    (32x32)
[email protected] (64x64)

In code we only need to refer to the original base name (minus the file extension). E.g.:

imageView.image = [NSImage imageNamed:@"logo"];

CSS does something very similar of course.

I have all of these same image assets included in the corresponding WPF project for Windows.

When I include them in the application resources file (.resx) the '@' becomes '_'.

That's fine I guess, but what now?

I have googled everything I can think of (against site:learn.microsoft.com) but none of the docs I can find talk about this type of thing. There's a lot of talk about high fidelity/res/dpi screens, but I don't see anything about this bitmap auto-substitution concept.

I don't have a retina display handy for testing and the place I'm contracting for doesn't have any QA engineers. The people who casually test the app (manager + a couple other EE/firmware devs) don't either, so I need to be certain I'm setting up the WPF port of this app correctly since I can't verify... at least for the next few weeks.

1

There are 1 best solutions below

1
pindumb On

Convert your PNGs to vector graphics and it will look perfect everywhere.