KImgIO
ico.h
Go to the documentation of this file.00001 /* 00002 * ico.h - kimgio import filter for MS Windows .ico files 00003 * 00004 * Distributed under the terms of the LGPL 00005 * Copyright (c) 2000 Malte Starostik <malte@kde.org> 00006 * 00007 */ 00008 00009 // You can use QImageIO::setParameters() to request a specific 00010 // Icon out of an .ico file: 00011 // 00012 // Options consist of a name=value pair and are separated by a semicolon. 00013 // Available options are: 00014 // size=<size> select the icon that most closely matches <size> (pixels) 00015 // default: 32 00016 // colors=<num> select the icon that has <num> colors (or comes closest) 00017 // default: 1 << display depth or 0 (RGB) if display depth > 8 00018 // index=<index> select the indexth icon from the file. If this option 00019 // is present, the size and colors options will be ignored. 00020 // default: none 00021 // If both size and colors are given, size takes precedence. 00022 // 00023 // The old format is still supported: 00024 // the parameters consist of a single string in the form 00025 // "<size>[:<colors>]" which correspond to the options above 00026 // 00027 // If an icon was returned (i.e. the file is valid and the index option 00028 // if present was not out of range), the icon's index within the .ico 00029 // file is returned in the text tag "X-Index" of the image. 00030 // If the icon is in fact a cursor, its hotspot coordinates are returned 00031 // in the text tags "X-HotspotX" and "X-HotspotY". 00032 00033 #ifndef _ICO_H_ 00034 #define _ICO_H_ 00035 00036 #include <QtGui/QImageIOPlugin> 00037 00038 class ICOHandler : public QImageIOHandler 00039 { 00040 public: 00041 ICOHandler(); 00042 00043 bool canRead() const; 00044 bool read(QImage *image); 00045 bool write(const QImage &image); 00046 00047 QByteArray name() const; 00048 00049 static bool canRead(QIODevice *device); 00050 }; 00051 00052 #endif
KDE 4.0 API Reference