I'm working on a cross platform application for Linux, Windows and macOS and there is part where I need to scale something based on the screen scaling. So far I have been using QApplication::desktop()->devicePixelRatioF() under Linux and Windows to get the scale factor and that works fine but now one of my users run into an issue with macOS where there is obviously screen scaling going on but the devicePixelRatio is always set to 1.
This is how scaling variables look like on his machine:
devicePixelRatio: 1
devicePixelRatioF: 1
logicalDpiX: 72
logicalDpiY: 72
physicalDpiX: 114
physicalDpiy: 114
I have also tried reading out the values from QApplication::primaryScreen()but they look the same.
QScreen devicePixelRatio: 1
QScreen logicalDotsPerInch: 72
QScreen logicalDotsPerInchX: 72
QScreen logicalDotsPerInchY: 72
QScreen physicalDotsPerInch: 113.5
QScreen physicalDotsPerInchX: 113.5
QScreen physicalDotsPerInchY: 113.5
According to my user he should have 227 dpi:
"13-inch MacBook Pro models introduced in late 2012 or later. Native resolution: 2560 x 1600 at 227 pixels per inch. Support for millions of colors."
Any idea whats going on here or how we could detect the scale factor?
Related
This has been bugging me for a while. Xcode 2.5 handles icons differently from later versions of Xcode so there is no Xassets file. Does anyone know how to set the app icon?
You need to add high resolution icon. Now, if you want to target only iOS 7, you just need 76 x 76, 120 x 120 and 152 x 152 icon sizes. If you also want to target iOS 6, you’ll need 57 x 57, 72 x 72, 76 x 76, 114 x 114, 120 x 120, 144 x 144 and 152 x 152 icon sizes. Below is the detailed description how to add the same.
Then add all of them as
Below is the list of icon dimensions.
Hope this helps.
So, I have an xcassets that is shared amongst quite a few apps. I'm developing with Xcode8 in a Mac Mini with MacOs Sierra installed in it. If I compile and run in the development machine, there's no issue at all. However, when I try to run it in a device with OSX Mavericks I get a crash. Here's the trace in the report
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff887dc866 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff87a3935c pthread_kill + 92
2 libsystem_c.dylib 0x00007fff88614bba abort + 125
3 libsystem_c.dylib 0x00007fff885dea5f __assert_rtn + 321
4 com.apple.coreui 0x00007fff875aa1a7 CUIRenditionKeySetValueForAttribute + 307
5 com.apple.coreui 0x00007fff875a9004 -[CUIStructuredThemeStore _canGetRenditionWithKey:isFPO:lookForSubstitutions:] + 200
6 com.apple.coreui 0x00007fff875a8f1b -[CUIStructuredThemeStore canGetRenditionWithKey:] + 22
7 com.apple.coreui 0x00007fff875c4eab -[CUICatalog _resolvedRenditionKeyForName:scaleFactor:deviceIdiom:deviceSubtype:] + 291
8 com.apple.coreui 0x00007fff875c4c53 -[CUICatalog imageWithName:scaleFactor:deviceIdiom:deviceSubtype:] + 29
9 com.apple.AppKit 0x00007fff88820b1b +[NSImage _catalogImageWithName:bundle:] + 132
10 com.apple.AppKit 0x00007fff8881aefd +[NSImage imageNamed:] + 261
If I remove the image from the xcassets and include it "individually" in the app's bundle -by dropping it to the app's project navigator- it loads just fine. But I'd like to avoid this if possible, as it's cleaner to have shared images in just one xcassets.
Any thoughts or ideas? Thanks in advance.
I could bypass this error by following this workaround provided by Apple for iOS 7 devices:
To work around this issue, update the deployment target to iOS 8.0 or
higher, or add a single image to the asset catalog that has at least
five attributes specified across the image set, such as: scale (1x,
2x, 3x) idiom (add iPad,iPhone, and a universal asset) direction (left
to right, right to left) width/height class (any & compact, and so
forth) memory (add a 1 GB asset) graphics (add a Metal 1v2 asset) It
is not necessary to use the image in your code or to add all of these
attributes. (27852391)
Here's how this dummy imageset looks like:
When submitting a Windows Phone 7 app, you need to include the following icons:
Large Mobile
Small Mobile
Large PC
Once listed on the market, the Large PC icon is displayed in the Marketplace on both the phone and PC - different style icons were used for each. What are these other icons used for?
Here is an image to clarify what we are seeing:
There are 6 images to be concerned about, but given pixel dimensions of two of them being the same, you could use just 5 images.
# Image Where Used? Size (Pixels) File Type Require/Option
1. Small mobile Phone Marketplace catalog 99 x 99 PNG Required
2. Large mobile Phone Marketplace catalog 173 x 173 PNG Required
3. Large PC PC Marketplace catalog (Zune) 200 x 200 PNG Required
4. Background Background panorama 1000 x 800 PNG Optional
5. App Icon In the app list on the phone 62 x 62 PNG Required
6. App Tile In the start page on the phone173 x 173 PNG Required
Notes:
1-4 are for selling/marketing your
app. 1-2 are shown in the
Marketplace on the phone and 3 is
shown in Zune. #4 - I believe it is
shown on both phone/Zune.
5-6 are used once the app is
installed. These are to be listed your WMAppManifest.xml as <IconPath IsRelative="true" IsResource="false">ApplicationIcon.png</IconPath> and <BackgroundImageURI IsRelative="true" IsResource="false">Background.png</BackgroundImageURI> respectively.
2 and 6 are the same pixel size, so they
can be the same, if that's what you want. I've done that.
You can use transparency on #6,
but don't use it on any other image.
If you browse the marketplace in the Zune software on the PC you'll see the 2 different size icons being used. The larger size is used in the list at the top of the page and the smaller size in the "we recommend" and "new apps" sections.
Firstly, please go to this url: celebritywallpaperbase
picture #1 is Drew Barrymore smile
picture #2 is Debby Ryan
They are both 1920x1400 but Safari on iPad displays picture #1 with 960 x 720, whereas picture #2 is dislpayed with its actual size 1920 x 1440.
I am making a photolib project for iPad & I wish Safari always display my photos with their actual size.
Thanks in advance!
Scott Chu
They have different DPI settings -
Drew's has 150 whereas Debby's has the more standard 72.
I'm setting a custom banner and dialog image for my WiX generated MSI.
<WixVariable Id="WixUIBannerBmp" Value="./build/msi/InstallerBanner.jpg" />
<WixVariable Id="WixUIDialogBmp" Value="./build/msi/InstallerDialog.jpg" />
For some reason, the image becomes corrupted when built into the MSI. I've added the two images to my question for easy comparison. I've tried BMP and JPEG with a whole range of compression types - and they all look exactly the same. I can verify that I'm using exactly the correct image dimensions (500 by 63 pixels).
Here's the original image:
Original image http://img193.imageshack.us/img193/7016/installerbanner.jpg
And here's what it looks like in the MSI:
Image in use - 1 http://img26.imageshack.us/img26/2996/bannerinuse.jpg
Update:
Thanks for your answers, I got the wrong dimensions from a tutorial, that's actually very out dated and (apparently) very inaccurate. Never the less, it's a good hacking resource. I'll stick to the manual in future!
Your image is too big dimension-wise. Banner Images must be 493 × 58 and your image is 500 × 63, causing it to be resized.
See Customizing Built-in WixUI Dialog Sets
By the way: nice to see Synergy2 is finally getting an update!
Andrew's right. It's covered in wix.chm.
Those are the wrong dimensions. From the relevant wix documentation topic:
Replacing the default bitmaps
The WixUI dialog library includes
default bitmaps for the background of
the welcome and completion dialogs and
the top banner of the other dialogs.
You can replace those bitmaps with
your own for product branding
purposes. To replace default bitmaps,
specify WiX variable values with the
file names of your bitmaps, just like
when replacing the default license
text.
Variable name / Description / Dimensions:
WixUIBannerBmp / Top banner / 493 × 58
WixUIDialogBmp / Background bitmap used on the welcome and completion dialogs / 493 × 312
WixUIExclamationIco / Exclamation icon on the WaitForCostingDlg / 32 × 32
WixUIInfoIco / Information icon on the cancel and error dialogs / 32 × 32
WixUINewIco / Button glyph on the / BrowseDlg 16 × 16
WixUIUpIco / Button glyph on the BrowseDlg / 16 × 16
Using WiX ver. 3.7.1224.0 (Dec'12), I have to create an image 616 × 390 to fill the dialog and avoid stretching. The clear zone to the left of the dialog text is 234 pixels wide.
The banner is still 493 × 58.
I found that to customize the WixUIDialogBmp for WiX 3.5, the dimensions must be 493x312 pixels. So, to make the banner only appear in the left 164 pixels of the dialog box, fill the right 329 pixels with white pixels. Then it should display correctly.
Try using .bmp images with specified dimensions as shown below
For more info : https://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html