Usuari Discussió:Bernat2

El contingut de la pàgina no s'admet en altres llengües.
De la Viquipèdia, l'enciclopèdia lliure
Infotaula de format de fitxerICO
Tipusicon graphics file format
Extensió.ico
MIMEimage/vnd.microsoft.icon
Uniform Type Identifiercom.microsoft.ico
DesenvolupadorMicrosoft
Infotaula de format de fitxerCUR
Tipuscursor graphics file format
Extensió.cur
DesenvolupadorMicrosoft

El format de fitxer ICO és un format d'imatge utilitzats per icona en Microsoft Windows. El CUR fitxer de format de cursors és gairabé idèntic, les úniques diferències són la idenificació de bytes i la especificació d'un punt d'accès en la capçalera.

Els arxius ICO contenen una o mes imatges petites amb diferents mides i colors.

El tipus d'arxius registrats oficialment per IANA són els ico MIME image/vnd.microsoft.icon . Abans de que aquest estigués registrat es va acceptar la opció que comlia amb les normes de l'ús de la x- per enregistrar pàgines image/x-icon. No obstant això, moltes altres opcions són acceptades, com ara image/ico, image/icon, text/ico, i application/ico. Molts servidors web, no estan configurats amb "l'ecenari" MIME dels arxius .ico, que podrien ser text/html o text/plain.


Mides de la icona, profunditats de colors i transparència de dades[modifica]

Originalment les icones eren de 32 × 32 píxels quadrats i es feien servir 16 colors, versions més recents de suports d'icones de Microsoft Windows pots crear icones de múltiples mides i profunditat de colors. Abans, la icona de les imatges de Windows XP podia ser de qualsevol mida a partir d'1 × 1 píxel fins a 255 × 255 píxels, i de 4, 8, 16 o 24 bits de profunditat de color. Comunament una icona d'arxiu que en el menú d'inici i la carpeta d'"icones grans, te una mida de 32x32, i si es troba en la barra del títol, en els submenús i en carpetes amb els icones petits seria de 16x16.

Icon image data was always made up of two bitmaps: the AND bitmap and the XOR bitmap. The AND bitmap is 1 bit per pixel and is applied first to decide which areas of the image are affected by the background. The XOR bitmap is then applied using XOR. This allows for transparent areas in the image but also allows for inverting the background and other tricks.

Windows XP adds support for 32-bit colour depth icon images, with transparency taken from the alpha channel of the image, allowing semitransparent areas like shadows and antialiased edges. The AND bitmap is not used when displaying 32-bit images in 32-bit mode, however it is still required as Windows XP can and will use a 32-bit image when in 24-bit mode by removing the alpha channel and applying the AND bitmap for transparency if no 24-bit image is available. If the AND bitmap is not included in 32-bit images, when forced to display these in 24-bit mode, the AND map will be assumed in an overflow read, producing an undesirable transparency pattern. Windows XP also adds the ability to display icons at up to 96×96 pixel resolution in the graphical shell; however, Microsoft only recommended icon sizes up to 48×48 pixels, so larger icon sizes are uncommon. Windows XP can read 256×256 pixel icon images and larger and it can resize them to use if no closer image size is available, but it has no native mode for common usage of these sizes.

Windows Vista adds support for natively displaying 256×256 pixel icon images, and supports (but does not require) the compressed PNG format. The PNG format encodes the image transparency data directly; it contains neither the XOR nor the AND bitmap data of the other icon image formats. It is recommended that all 256×256 icons should be stored in the ICO file in PNG format to reduce the overall size of the file. The Windows Vista graphical shell supports "zooming" the display in and out; as a result, more icon formats (including the larger, 256×256 format) are recommended.

ICO files can be edited or exported with a number of graphics programs, among them CorelDraw, IrfanView and Paint.NET (via a plugin).

Icon library[modifica]

An icon library is a way to package Windows icons. It is typically a New Executable binary having .ICL extension with icon resources being the packaged icons.

File structure[modifica]

All values are represented in little-endian (Intel standard) format.

Icon Header Stores general information about the ICO file.
Directory[1..n] Stores general information about every image in the file.
Icon #1 The actual "data" for the first image in old AND/XOR DIB format or newer PNG
...
Icon #n Data for the last icon image

Header[modifica]

Offset# Size Purpose
0 2 reserved. should always be 0
2 2 type. 1 for icon (.ICO), 2 for cursor (.CUR) file
4 2 count; number of images in the file

Directory[modifica]

Offset# Size Purpose
0 1 width, should be 0 if 256 pixels
1 1 height, should be 0 if 256 pixels
2 1 colour count, should be 0 if more than 256 colours
3 1 reserved, should be 0[1]
4 2 colour planes when in .ICO format, should be 0 or 1[2], or the X hotspot when in .CUR format
6 2 bits per pixel when in .ICO format[3], or the Y hotspot when in .CUR format
8 4 size in bytes of the bitmap data
12 4 offset, bitmap data address in the file

Recommended icon sizes for Windows Vista compatibility[modifica]

The full set of standard icon sizes which should be provided differs based on where the icon will be shown in the Windows UI. Microsoft provides guidelines which can be found at http://msdn.microsoft.com/en-us/library/aa511280.aspx; specifically, under "Color and saturation" and "Size requirements".


References[modifica]

  1. Although Microsoft's technical documentation states that this value must be zero, the icon encoder built into .NET (System.Drawing.Icon.Save) sets this value to 255. It appears that the operating system ignores this value altogether.
  2. Setting the colour planes to 0 or 1 is treated equivalently by the operating system, but if the colour planes are set higher than 1, this value should be multiplied by the bits per pixel to determine the final colour depth of the image. It is unknown if the various Windows operating system versions are resilient to different colour plane values.
  3. The bits per pixel might be set to zero, but can be inferred from the other data; specifically, if the bitmap is not PNG compressed, then the bits per pixel can be calculated based on the length of the bitmap data relative to the size of the image. If the bitmap is PNG compressed, the bits per pixel are stored within the PNG data. It is unknown if the various Windows operating system versions contain logic to infer the bit depth for all possibilities if this value is set to zero.

See also[modifica]

External links[modifica]

Category:Graphics file formats Category:Microsoft Windows multimedia technology Category:Computer icons

de:ICO (Dateiformat) fr:ICO (format de fichier) it:.ico ru:ICO fi:ICO (tiedostomuoto) sv:.ico uk:ICO zh:ICO