How does the Windows Shell resize icon overlays? - windows

I've written a Shell Icon Overlay handler that contains a multi-image icon with 256, 48, 32 and 16 bit icons. The overlay bits are in the lower left corner, and respectively are 32, 15, 10 and 6 bits.
In Windows Explorer, with the View set to Small, the icons are 16 bits and the overlay selected consumes 6 bits. Medium icons: 48 bits overlaid with 10. All as I expected.
When the View is set to Large, a 96 bit icon is used, which is overlaid with 15 bits. Whether this is the 15 bits from the 48 bit overlay, or downsampled from the 256 bit, I can't tell. If I add a 96 bit overlay to the multi-image, using 32 bits for the overlay (just as a test), the overlay used still appears as 15 bits.
When the View is set to Extra Large, the overlay used is still just 15 bits. Just a splotch on a very big icon.
All of the above is on Windows 7. On Windows 8 desktop, the same results are seen, EXCEPT that the Extra Large icon is now only overlaid with a 12*12 bitmap, clearly downsampled from a larger size (15? 32?)
Can anyone help with a definitive answer for what size overlays I should be providing for maximizing the viewing experience?

If you see on overlay icon of lnk file in imageres.dll you will see that icon contains the following formats:
48x48x16
32x32x16
16x16x16
48x48x8
32x32x8
16x16x8
256x256x32
48x48x32
32x32x32
16x16x32
I think if Microsoft uses such formats for internal overlay icons it is optimal variant to use the same formats too.

Related

Why are fonts of the same size displayed with different heights in different programs?

I am currently working on a GUI at a Windows 7 64-bit PC. While comparing the visualisation of text in different programs, I recognized, that there are differences in how big text is displayed on my monitor, given the same text style and size.
Does anyone has an idea where this comes from?
I created this behaviour by typing a text in Arial Regular 12pt containing the letter T in a program and scaling the view to 100%. Afterwards I measured the height of the letter T in pixels with the help of a screenshot.
Programs I testet:
MS Word 2010: T is 12 pixels high
LibreOffice Writer 5.2.7.2 (x64): T is 12 pixels high
Scribus 1.4.6: T is 12 pixels high
GIMP 2.8.14: T is 9 pixels high
Java 8 Update 181 (which I use for my own GUI): T is 9 pixels high
pt (point) is a unit for physical sizes, typically 1/72th of an inch.
In order to transfer this to a size in pixels, you need to know how many pixels will be in one inch on your screen. This value is known as Pixels Per Inch (PPI), sometimes somewhat ambiguously called Dots Per Inch (DPI).
Note that this value will usually be different for an application UI and the documents you are working on.
From the values you provided, it looks like MS Word, LibreOffice and Scribus assume 72 PPI (or at least the documents you are working on do), whereas GIMP and Java use 96 PPI.
It's not obvious whether you are referring to the size of text ion the respective applications' UI or documents opened in them, though, so I could be totally off.

What are the image sizes for custom Visual Studio 2010 templates?

I'm making a custom template for Visual Studio 2010. In the .vstemplate file, I can specify images for <Icon> and <PreviewImage>. What are the sizes of these images?
There are three sizes respectively:
Icon image
16x16 pixels for the if the Small Icons option is selected for
listing project templates.
32x32 pixels if the Medium Icons option is selected.
Preview image
200x200 pixels regardless the size of the image you specify.
For more, see a post of mine: https://dolinkamark.wordpress.com/2015/03/10/how-to-create-a-visual-studio-2013-project-template/
Which I know is about vs 2013, however it applies to previous versions if my memory serves. And unfortunately as you have written in your comment, these conclusions for image sizes and types are from trial and error as I haven't found any specifications on MSDN about this.
The default template icon (__TemplateIcon.ico) for Visual Studio 2015 has the following modes (used Microangelo Studio to find out):
256x256 32 bit colors (XP) (which includes alpha channel), with PNG compression
256x256 8 bit colors (256), with PNG compression
64x64 32 bit colors (XP), no compression
48x48 32 bit colors (XP), no compression
48x48 8 bit colors (256), no compression
32x32 32 bit colors (XP), no compression
32x32 8 bit colors (256), no compression
16x16 32 bit colors (XP), no compression
16x16 8 bit colors (256), no compression
The default colors are:
front: 66, 66, 66 (hex: 424242)
backdrop: 246, 246, 246 (hex: f6f6f6)
Seems the 'Dark theme' repaints the icon somehow
Here are my empirical approach to this issue:
Icons size used into the item template selection wizard are 32x32 pixels (ICO format).
PreviewImage are placed centered without cropping or scrolling if the image keeps itself under 200x380 pixels (PNG format). Note: vertical size also depends on how many text you enter as description.
Sizes seems similar in VS2010 & VS212.

VB6 app icon in Windows 7 taskbar is blurred

I have a VB6 application and one of the Form icon is set as application icon. The problem is that in Windows 7 the icon looks blurred even though the icon contains 16x16, 32x32 and 48x48 sizes.
Is there a way around this problem? It tried the SendMessage(... SETICON... ICON_BIG) but it does not seems to work.
What colour depth are the icons in your ico file?
VB6 (I believe) supports a maximum 8 bit colour depth (256 colours) for icons:-
So if there is no size 48 x 48 icon in 8 bit colour depth it could be using the nearest match and scaling it to 48 x 48
EDIT:
I just tried this using an icon that did not have a 48 x 48 icon at 8 bit depth (but did have 48 x 48 at higher depths) and the icon used in the taskbar was the 32bit icon at 8 bit colour depth.
I don't claim to understand the full heuristics used to choose the icon image to display in various places, but I think what is happening here is that your 48x48 image is being taken and scaled down.
I suspect what happens with a VB6 program on many versions of Windows is that if there is no 16-color 16x16 image then a larger size gets taken and scaled. The reason may simply be due to the order of the images in the ICO resource/file.
If you edit your ICO and add a 16-color version of your 16x16 image your "problem" may disappear.

WP7 finger friendly controls size

Which would be the best size for different WP7 controls(like listview items, buttons etc) in order to be "finger friendly"? Is any resource that handle this problem?
According to the UI Design and Interaction Guide for Windows Phone 7 v2.0:
Touch targets should not be smaller than 9 mm or 34 pixels square and
provide at least 2 mm or 8 pixels between touchable controls. In excep-
tional cases, controls can be smaller but never more than 7 mm or 26
pixels square. The on-screen keyboard and hyperlinks in Windows Phone®
Internet Explorer® are an exception because they have differently sized hit
targets.

Ideal size for .ico

What is an ideal size for a .ico file, that would sit in the top corner of a window?
Short answer: 16 x 16 pixels.
Long answer:
.ico files can actually contain multiple images, at multiple colour depths - you can provide 16x16, 32x32, 48x48 and 64x64 in a single file and the OS will pick the best one to show.
Of course to keep the file size low you don't want to put too many in there, but if you think people might be saving a link on their desktop (say it's a web application) then it's probably a good move.
See Microsoft's recommendations.
Basically, 16x16, 32x32, 48x48, and 256x256 for application icons. I guess the window icon is a toolbar icon so 16x16, 24x24 and 32x32.
To originally figure this out when wanted to start making .ico images I opened a good looking icon already being used in Windows 11 with GIMP. I found nine layers 256 128 64 48 40 32 24 20 and 16. So this is kind of the formula I've been following creating the icons in Gimp and none of my icons fail ever they always display no matter what size they are.
With GIMP you can take any single image and turn it into a multi-layer icon, you just have to know how to do a bit of image editing.But it %100 free.

Resources