I have an iPad with a Retina display and all things are loading nicely apart from some images (they don't show up in random).
What I have tried so far:
Use -webkit-transform: translateZ(0); on those elements - didn't work
Use data-at2x="<?= $img[0][1][0];?>" on the <img> tag - didn't work
What else could I try?
Have a look at the Apple naming convention in their "Resource Programming Guide" on page 46.
The bundle- and image-loading routines automatically look for image
files with the #2x string when the underlying device has a
high-resolution screen. If you combine the #2x string with other
modifiers, the #2x string should come before any device modifiers but
after all other modifiers, such as launch orientation or URL scheme
modifiers. For example:
MyImage.png - Default version of an image
resource.
MyImage#2x.png - High-resolution version of an image
resource for devices with Retina displays.
MyImage~iphone.png -
Version of an image for iPhone and iPod touch.
MyImage#2x~iphone.png -
High-resolution version of an image for iPhone and iPod touch devices
with Retina displays.
Related
If I have the full path of an application's bundle or an NSBundle instance for that application, how can I get an NSImage representation of that app's icon?
Specifically, I'd like to get the best available version of the icon for a particular set of dimensions. For example, if the available versions of an app's icon include dimensions 32x32, 64x64, and 128x128 points, if I request one for 96x96 points I would get the 128x128 version.
This will need to work on both retina and non-retina displays, so the resulting NSImage will have to include both retina and non-retina representations of the icon.
I've found the iconForFile: method of NSWorkspace but unfortunately it only gives back a 32x32 pixel icon, so that's not useful for my purposes.
I could also read in the bundle's CFBundleIconFile and CFBundleIconName keys from its info dictionary, and then pull the correct image from its icns file or assets catalog, but that seems like a lot of work. I'm not sure where to begin with getting images from either of those file types. I hope there's an easier way!
I was incorrect about iconForFile:. While the NSImage it returns does report its size as being 32x32, it contains image representations for all of the various icon sizes for that application, including much larger ones. It's a simple matter of choosing the one I want, or using the bestRepresentationForRect:context:hints: method.
Just got the new Apple TV and I am trying to setup App Icons for a new app. It is asking for Front, Middle and Back images for both "App Icon - Large" and for "App Icon Small". I have tried putting a 512x512 image in for Middle and get the following error:
The last image stack layer with content, "Middle", must exactly fill the image stack. Its current frame is {{384, 128}, {512, 512}} while the image stack's size is {1280, 768}.
Does a 1280x768 image need to be used? More importantly, what exactly is needed in terms of image assets for tvOS Apps?
You need at least 2 images for both the App Icon - Large & App Icon - Small
(So total of 4 images - I used at first just the front & back, then I used all three layers for a total of 6 images)
The large icon is 1280x768, and the small one is 400 x 240
Apple's document:
https://developer.apple.com/tvos/human-interface-guidelines/icons-and-images/
Doesn't seems to specify that you only need one image for the 1280x768. But
I wasn't able to submit my App with just one image. I rendered my icons in the
full 1280x768 size and then scaled to 400 x 240.
In addition, you need to add the Top Shelf image which is 1920 x 720.
(Top Shelf Wide seems to be 2320 x 720.)
https://developer.apple.com/forums/thread/20689
Yes, you have add mismatched icons, that's why getting the error
Once you check all the sizes is correct
I knew that in [NSImage imageNamed] method, it will try to load retina image on Retina Mac while load non-retina image on Non-Retina Mac, but it was only applied on Resources directory, is there any other method can do the similar thing on other user-defined directory ?
If the image does not exist in two sizes with one named with the #2x naming convention then you will need to make a best guess judgment call.
You may also get some useful metadata about the image like DPI to figure out what makes sense.
I am planning to make a universal app to support retina display. It will be a quiz with more than 100 questions. So, for the bg images the suffix will be: iPhone, iPod:320X480 = photo.png, retina iPhone, iPod: 640X960 = photo#2x.png iPad: 1024X748 = photo~ipad.png and for retina iPad 2048 X 1496 (apple doc?) (1536?) = photo#2x~ipad.png . Do I need to write any additional code? Would it be too much to include 4 images for every question, that means 4 images X 120 questions = 480 images!!!Would it be to heavy?
The suffix the OS is looking for is "#2x.png"
So if you want to do separate graphics for iPhone versus iPad, put those differences in their filenames before the #2x part.
And yeah, four images does seem a bit like overkill. Why not just simply have regular resolution image and a high resolution image for various UI widgets used in both your iPad and iPhone versions?
What I'm trying to do:
I've added a splash screen to an application I'm creating for Windows Phone 7. I did this simply by replacing the pre-existing splash screen file with my own.
What goes wrong:
The splash screen is not displayed like it should be - it is being down sampled to an 8 bit image or something weird:
-
The image I'm using
-
The image that gets displayed
It's a bit hard to see depending on your monitor, but on a phone it's reasonably obvious. There are fuzzy greenish lines that appear - basically like the image is being down sampled or the quality worsened.
Any idea what I'm doing wrong, or what might be happening?
Thanks.
Try forcing the app to display images at 32 bits per pixel (instead of the default of 16)
Add an attribute of BitsPerPixel="32" to the app element in WMAppManifest.xml
See http://forums.create.msdn.com/forums/p/85960/520394.aspx#520394
The problem is that the gradient on your splash screen is causing banding, which you can solve by dithering. Robby Ingebretsen has an action for PhotoShop that you can use: http://nerdplusart.com/photoshop-action-for-windows-phone-7-dithering
I suspect the emulator. Run the emulator at full size or run the app on an actual device.
Windows Phone is currently only supporting a color depth of 16bit, causing especially some gradients displaying downsampled for 24bit images. Some first generation firmwares by HTC had a "bug" that also allowed 24bit. Theoretically it is just a registry key, but you cannot commonly change it. Microsoft has limited the color depth to 16bit for the benefit of performance, but as far as I knnow there are some second-generation models without this limitation now.
You may try to downsample the image in Photoshop to 16bit and optimize it for this color depth.