When I add a multi-resolution-icon file to my Windows application in Visual Studio 2013 it seems Windows and/or VS ignores the resolution and it seems the 32x32x24bit icon is used for the task-bar. My icon file contains the following resolutions: 16x16,32x32,48x48,256x256 with 8-bit and 24-bit each. The application itself is DPI-unaware but expected that an appropriate icon is used though. Ideas?
There are very particular specifications for what formats should be present in your icon resources if you want Windows to use them properly. If you don't follow their recommendations you will get very inconsistent results from your application.
https://msdn.microsoft.com/en-us/library/windows/desktop/dn742485(v=vs.85).aspx has the guidelines you will want.
Application icons and Control Panel items: The full set includes
16x16, 32x32, 48x48, and 256x256 (code scales between 32 and 256). The .ico file format is required. For Classic Mode, the full set is 16x16,
24x24, 32x32, 48x48 and 64x64.
List item icon options: Use live
thumbnails or file icons of the file type (for example, .doc); full
set.
Toolbar icons: 16x16, 24x24, 32x32. Note that toolbar icons are
always flat, not 3D, even at the 32x32 size.
Dialog and wizard icons:
32x32 and 48x48.
Overlays: Core shell code (for example, a shortcut)
10x10 (for 16x16), 16x16 (for 32x32), 24x24 (for 48x48), 128x128 (for
256x256). Note that some of these are slightly smaller but are close
to this size, depending on shape and optical balance.
Quick Launch
area: Icons will scale down from 48x48 in Alt+Tab dynamic overlays,
but for a more crisp version, add a 40x40 to .ico file.
Balloon icons:
32x32 and 40x40.
Additional sizes: These are useful to have on hand as
resources to make other files (for example, annotations, toolbar
strips, overlays, high dpi, and special cases): 128x128, 96x96, 64x64,
40x40, 24x24, 22x22, 14x14, 10x10, and 8x8. You can use .ico, .png,
.bmp, or other file formats, depending on code in that area.
Related
Afternoon all,
I'm building a custom ribbon in VB .NET for Excel 2013/6 and have made images that show up looking like they are hand drawn with a crayon.
My images are 50x50 pixel PNGs and set to small size.
I note here that there are recommended dimensions:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd316921(v=vs.85).aspx
Are the images required to be exactly those pixel dimensions and if not, any ideas why they show up not sharp?
I have also tried different starting file types (PNG, JPEG, BMP) which didn't help.
For the Office Ribbon UI the accepted sizes are 32x32 or 16x16. The former will give higher resolution.
The optimal file format is *.png.
The link you provide is for Windows Ribbon, not the Office Ribbon, which is why the result you're getting is not what you expect.
I have icons (.ico) in my vb6 application. They are of various dimension 16x16 and 32x32.
I want all the icons to be converted to 48x48 256 image format. Can I load a 48x48 icon file (.ico) in a VB6 form?
I want to know if VB6 support any other image format apart from .ico files?
Thanks
VB6 is capable of using icon files (.ico), including icon files with 48x48 pixel icons. I presume you were referring to Icons that can be assigned to forms for the purpose of displaying them on their title bars, in the far top-left corner. This can be done by assigning an Icon file to each form's Icon property during design time; or at run time, usually from either an ImageList control or Resource file (.res). However, with the exception of some Cursor files (.cur), VB6 is not capable of displaying an image for the same purpose, using another file format other than .ico (.bmp, .gif, .jpg, etc. cannot be used).
Icon images can also be used to display images elsewhere on forms, such as through the use of the PictureBox and Image controls.
Please note that there is no need to convert multiple icons to a particular format, as single Icon files (.ico) are capable of storing multiple icons of different dimensions and colour depths. When multiple icons are present within a program's icon resource, Windows Explorer will display the appropriate icon dimension for a particular file / folder view. For example, a 16x16 pixel version of the icon will be shown in "Small Icon", "Details" and "List" views, while a 48x48 pixel version will appear when the view is set to "Medium Icons". When a particular version of an icon is not available, Windows Explorer will usually try to use one of the other versions that is closest to what needs to be displayed for a particular view, which may involve stretching an icon to a larger or smaller size. Pixels of colours not able to be displayed from a high colour (24 bit) icon in a 256 colour mode, will be converted automatically to their closest equivalents, from a default system colour palatte. The disadvantage of the absence of multiple versions of the same icon, is that the quality of the icons will be reduced in particular file / folder views.
In Cocoa application I've got 16x16 and 32x32 #2x version of an image: . When the image is displayed in NSImageView Mac OS X always picks higher-resolution version (i.e. downscales the #2x image on non-retina displays instead of using the 1:1 version).
(IB on the left = good, running app on the right = downscaled mess)
Of course I've got both images added to the project (as image.png and image#2x.png).
If I delete the #2x image from app bundle then OS X will display the lower-resolution image.
The bug happens regardless whether Xcode (4.6.2) combines them into a .tiff or not (and I've checked that the combined .tiff contains both images).
Oddly this happens only with this particular image. Other 1x/2x images in the same project are displayed correctly matching screen DPI.
How is that possible?! Do images have to meet some special criteria other than size and filename pattern?
Mystery solved: OS X doesn't like mixed types of PNGs.
$ file *.png
image.png: PNG image data, 16 x 16, 8-bit gray+alpha, non-interlaced
image#2x.png: PNG image data, 32 x 32, 8-bit colormap, non-interlaced
if both files are forced to use same color mode (i.e. both gray or both paletted) then OS X selects images correctly.
It turns out to be the NSImage’s prefersColorMatch property [1]:
The default value is YES. Both color matching and resolution matching may influence the choice of an image representation.
It is possible to set to NO in User Defined Runtime Attributes in Interface Builder [2].
[1] https://developer.apple.com/documentation/appkit/nsimage/1520010-preferscolormatch
[2] Are specific PNG compression types incompatible with macOS Cocoa apps?
I'm an experienced developer but a relative newbie with Cocoa. The Cocoa documentation says that toolbar items (NSToolbarItem) are 32x32 in regular size and 24x24 in small size. It goes on to say that you can (and should) include an image that includes both sizes and that a multi-page TIFF or an ICNS file can be used. This is where I am confused. I have tried several different programs that create ICNS files but all of them create files including 16x16, 32x32, and bigger. Is the assumption that the 24x24 toolbar icon uses a 16x16 image or is there a way to create a ICNS file with a 24x24 image? Or are people using an application to create multi-page TIFF files?
Use Icon Composer.app and supply the 16 and 32 sizes. The system will automatically up- or down-scale between them as needed and usually does a very good job of it.
I'm having trouble viewing a file that is declared to be a TIFF HDR image by Hugin.
Windows Explorer "Properties => Details" states that the bit-depth of the image is 128
Windows Explorer shows it as a white image.
I've tried converting the image to JPEG via ImageMagick, white image.
Picasa Image Viewer says "Invalid image".
I've tried opening it in Photoshop CS5, white image.
These are the stiching options set in Hugin; http://i.imgur.com/vmzA9.png
These is the Images tab in Hugin; http://i.imgur.com/33ySq.png
This is the entire output of Hugin; http://i.imgur.com/smV6O.png
Here is the complete TIFF _hdr file; http://c759972.r72.cf0.rackcdn.com/DSC_3873-DSC_3875_hdr.tif Size: 64 MB
So, is the problem that I'm not viewing it in the correct mode -- or that it really is a white image?
I imported your image using Mathematica. After import, it appears white. That is because the pixel values are not scaled properly: The maximum value is 1070 whereas any value greater than 1 is displayed as white. When rescaling the values to run in the range from 0 to 1, one can see the following:
In[64]:= image = Import["http://c759972.r72.cf0.rackcdn.com/DSC_3873-DSC_3875_hdr.tif"];
In[65]:= ImageType[image]
Out[65]= "Real32"
In[66]:= Max[ImageData[image]]
Out[66]= 1070.
In[67]:= ImageAdjust[image]
Either the image file is indeed corrupted, or the various programs can't read it. Anyway, the image is not white. There seems also to be some mis-alignment between the poses that were used to create the HDR.