What size image should I use for BlackBerry context menus? - blackberry

The BB OS 5.0 supports images for context menus. The API documentation says the image will be scaled to fit a square set by the height of the menu font. I find that totally unhelpful.
The only way I can explain that method of calculation is due to screen resolution and DPI. But since the 5.0 OS is only valid on a handful of devices with similar screen sizes, I reckon they can specify the actual icon size they use.
I'd like to choose an icon size that's closest to the default menu font height so that the they look OK.
What size do you use? Do you even use this feature?

I haven't used it yet, but I would recommend using any square ratio maybe up to 64x64; the problem is that with new devices on the horizon (eg rumored tablet - with much bigger display) it won't necessarily be practical to target a specific screen size.

Related

How can I find the correct size of tray bar icons? [duplicate]

I noticed that my app sends icons to the Windows tray with a size of 16x16 pixels--and my Vista PC I've got a doublewide taskbar that appears to show icons at 18x18. The resizing artifacts on my app's icon look awful. How can I ask Windows what size the icons should be?
Edit
I'm generating the icon dynamically, with a pixel font text overlay. It seems wasteful to generate a bunch of icon sizes dynamically, so it would be nice to avoid building an icon with all the "possible" sizes (not that I'm even sure what those are).
GetSystemMetrics(SM_CXSMICON) returns 16--the incorrect value.
GetThemeBackgroundContentRect didn't help, either.
Create your icons in multiple formats, and let Windows select the one it wants.
Here's the Wikipedia article on the .ico format.
If you really need to know, GetSystemMetrics with a parameter of SM_CXICON or SM_CYICON will tell you the width and height that Windows wants to load.
Mark's core answer is the right one: Create your icons in multiple formats and let Windows choose the right one. Don't forget to do 32x32 and 64x64 icons for HighDPI scenarios.
But SM_CXICON/SM_CYICON won't necessarily return the size that will be used in the taskbar. The taskbar chooses the right icon size for it's size (this is much more important in Window 7).
Just provide appropriately sized icons and you should be ok.
Your best bet may be GetThemeBackgroundContentRect passing TBN_BACKGROUND as iPartId for the tray notify background.
GetThemeBackgroundContentRect should return the size defined by the current theme that may be used for drawing without overlapping the borders of the parent element. If I'm reading this correctly, that would be the largest sized notification icon permissible and presumably the size that is being used.
Testing with multiple DPI settings is probably the easiest way to tell if this is returning the correct value.
Per the NOTIFYICONDATA documentation:
If only a 16x16 pixel icon is provided, it is scaled to a larger size in a system set to a high dpi value. This can lead to an unattractive result. It is recommended that you provide both a 16x16 pixel icon and a 32x32 icon in your resource file. Use LoadIconMetric to ensure that the correct icon is loaded and scaled appropriately. See Remarks for a code example.
...
...
// Load the icon for high DPI.
LoadIconMetric(hInst, MAKEINTRESOURCE(IDI_SMALL), LIM_SMALL, &(nid.hIcon));
...
So, creating icons dynamically really isn't the best option. You should provide multiple icons of different sizes statically in your program resources and let Windows choose the best one it wants.

How to scale fontsize on different devices programmatically (Xamarin.android)?

I'm new to Xamarin and I'm actually developing an Android App. I've tried to run the app on different Android phones, but the fontSize appears either too small or large. Programmatically, how can I scale the FontSize of texts so that it can be adjust according to the device's screen?
Firstly, make sure you are using sizes in dp not px (or in, mm etc.) as these will factor in the screen density.
If you still have an issue, look at Screens support in the Android Docs, especially Using configuration qualifiers. Examples can be found here.
Basically you would need to provide a different resource file for each screen size. You should have a file something like res/values/dimens.xml where you store sizes for all your components. Make sure your font sizes are declared and referenced from here. You can then create a series of folders/files for the different screen sizes
res/values/dimens.xml
res/values-sw320dp/dimens.xml
res/values-sw720dp/dimens.xml
res/values-sw1024dp/dimens.xml
where each of these folders define the smallest width screen that that file will be used for.

How to choose the size/resolution for custom images for use in iOS applications?

I understand how 1x, 2x and 3x image resolutions work but I'm unsure how I go about choosing the right size/resolution for custom images in general. Imagine that we have a simple layout like the following:
Now it is up to me to create the image (in Photoshop for example) for that UIImageView. What size and resolution should the highest quality version be? Do I just use the highest screen resolution of the iOS devices that are currently available as my guide?
There is not really a best size. As you said the highest screen resolution would be the maximum, because the device obviously can not display more pixels than it has provided. If the image view is only about 1/5 of the screen size then I would use a smaller image size for memory usage.
And you only need one size for background images for example. I normally place them in my assets folder into the 2x place and I am good.
For icons i use 25x25, 50x50 and 75x75 (which will display really small on the screen)
hope I could help you a little bit…

Application icons is pixelated

I'm trying to set an icon for my app, however the icons derived from the original image are pixelated and look bad. I tried to provide the app icon gear application with images of different sizes, however the result is still unpleasant.
Should I provide it with images of higher resolution or lower resolution to get better results?
The answer to this question links to to a matrix provided by Apple for icon sizes. Should I use these sizes strictly, consider them as a lower border not to go under, or consider them as a ceiling not to exceed?
The docs states
Table 45-1 lists the sizes required for these custom icons and images.
Use the exact sizes.

Photoshop Font Pixel Size to Xcode Interface builder Font Point Size

How do I match the font pixel size given to me by my designer in PhotoShop to the correct font size in Xcode Interface builder.
For example, my designer is using Helvetica Neueu Regular 32px Font in his design.
I've used a few points to pixel translation sites, but it doesn't seem exact.
I have attempted to follow the answer from this question, but to no avail:
https://stackoverflow.com/a/6107836/1014164
You will never have perfect results when visually comparing a Photoshop comp to a real program. In fact, it's not un-common for a text layout to be different between different computers because version and operating system differences (as well as monitor layouts) cause the text to reflow every time it's edited.
Unless things are very much different in other versions of Photoshop, your designer hasn't specified 32px because Photoshop doesn't lay text out in pixels - it works in points/picas. The exact text rendering is also dependent on the document's resolution (which is different between print and screen).
The best you can do is get the text to look roughly proportional to the designer's intent. In modern iOS, most apps will use the user's customized font settings anyway.

Resources