2
* ico.h - kimgio import filter for MS Windows .ico files
4
* Distributed under the terms of the LGPL
5
* Copyright (c) 2000 Malte Starostik <malte@kde.org>
9
// You can use QImageIO::setParameters() to request a specific
10
// Icon out of an .ico file:
12
// Options consist of a name=value pair and are separated by a semicolon.
13
// Available options are:
14
// size=<size> select the icon that most closely matches <size> (pixels)
16
// colors=<num> select the icon that has <num> colors (or comes closest)
17
// default: 1 << display depth or 0 (RGB) if display depth > 8
18
// index=<index> select the indexth icon from the file. If this option
19
// is present, the size and colors options will be ignored.
21
// If both size and colors are given, size takes precedence.
23
// The old format is still supported:
24
// the parameters consist of a single string in the form
25
// "<size>[:<colors>]" which correspond to the options above
27
// If an icon was returned (i.e. the file is valid and the index option
28
// if present was not out of range), the icon's index within the .ico
29
// file is returned in the text tag "X-Index" of the image.
30
// If the icon is in fact a cursor, its hotspot coordinates are returned
31
// in the text tags "X-HotspotX" and "X-HotspotY".
33
#ifndef _ICOHANDLER_H_
34
#define _ICOHANDLER_H_
36
#include <QtGui/QImageIOPlugin>
38
class ICOHandler : public QImageIOHandler
44
bool read(QImage *image);
45
bool write(const QImage &image);
47
QByteArray name() const;
49
static bool canRead(QIODevice *device);