Hi everybody,
How can I force my plugin to load the @2x graphics? It doesn’t look sharp enough when resized with the regular size images.
Any light on the issue will be appreciated.
Hi everybody,
How can I force my plugin to load the @2x graphics? It doesn’t look sharp enough when resized with the regular size images.
Any light on the issue will be appreciated.
The “sharpness” of the image depends on the video monitor resolution (ppi). High resolution monitors will load the @2x images (if available). Standard definition monitors will load the 1x images.
If you somehow “force” load the @2x graphics when the system doesn’t call for it the image will be drawn 2x larger, not sharper.
Now, that said, I have found a couple of tricks in iPlug2:
For the sharpest images on all monitors use Vector graphics wherever possible.
Thanks for your answer.
How do you load the @x2 only?
in config.h
#define PNGBACKGROUND_FN “bg.png” //Just coment out this line?
#define PNGBACKGROUND_2X_FN “bg@2x.png”
in main.rc
PNGBACKGROUND_FN PNG PNGBACKGROUND_FN //Remove this line?
PNGBACKGROUND_2X_FN PNG PNGBACKGROUND_2X_FN
in MyPlug.cpp
const IBitmap backgroundBitmap = pGraphics->LoadBitmap(PNGBACKGROUND_FN); //Should I change that to PNGBACKGROUND_2X_FN?
Thanks again.
The magic combination - that seems to work properly in all formats (VST, VST3, AAX and AU) on both Mac and PC - is:
in config.h - list BOTH the 1x and 2x file names
#define PNGBACKGROUND_FN “bg.png”
#define PNGBACKGROUND_2X_FN “bg@2x.png”
in main.rc - list ONLY the 2x file names
PNGBACKGROUND_2X_FN PNG PNGBACKGROUND_2X_FN
in MyPlug.cpp - use the 1x resource name
const IBitmap backgroundBitmap = pGraphics->LoadBitmap(PNGBACKGROUND_FN);
place ONLY the @2x.png files in the project “resources/img” folder
use the 1x size when setting PLUG_WIDTH and PLUG_HEIGHT in config.h and all control x/y locations in mLayoutFunc.
This approach forces the plugin to load the @2x files for every situation. The advantage is that 1) we only need to create 1 set of bitmap files (the 2x ones) and 2) bitmaps render somewhat sharper on standard def monitors.
I design all my plugin backgrounds and IBitmap controls at 2x size and then simply export a 50% version to find the 1x coordinates for the controls, PLUG_HEIGHT/WIDTH, etc.
This is working for me everywhere I have tested it but if anyone knows of any potential issues please advise.
Thank you for for all the info, that’s exactly what I was looking for. Works great.