src/plugins/imageformats/ico/qicohandler.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
   377 }
   377 }
   378 
   378 
   379 void ICOReader::readColorTable(QImage & image)
   379 void ICOReader::readColorTable(QImage & image)
   380 {
   380 {
   381     if (iod) {
   381     if (iod) {
   382         image.setNumColors(icoAttrib.ncolors);
   382         image.setColorCount(icoAttrib.ncolors);
   383         uchar rgb[4];
   383         uchar rgb[4];
   384         for (int i=0; i<icoAttrib.ncolors; i++) {
   384         for (int i=0; i<icoAttrib.ncolors; i++) {
   385             if (iod->read((char*)rgb, 4) != 4) {
   385             if (iod->read((char*)rgb, 4) != 4) {
   386             image = QImage();
   386             image = QImage();
   387             break;
   387             break;
   572                     if (!image.isNull()) {
   572                     if (!image.isNull()) {
   573                         readBMP(image);
   573                         readBMP(image);
   574                         if (!image.isNull()) {
   574                         if (!image.isNull()) {
   575                             QImage mask(image.width(), image.height(), QImage::Format_Mono);
   575                             QImage mask(image.width(), image.height(), QImage::Format_Mono);
   576                             if (!mask.isNull()) {
   576                             if (!mask.isNull()) {
   577                                 mask.setNumColors(2);
   577                                 mask.setColorCount(2);
   578                                 mask.setColor(0, qRgba(255,255,255,0xff));
   578                                 mask.setColor(0, qRgba(255,255,255,0xff));
   579                                 mask.setColor(1, qRgba(0  ,0  ,0  ,0xff));
   579                                 mask.setColor(1, qRgba(0  ,0  ,0  ,0xff));
   580                                 read1BitBMP(mask);
   580                                 read1BitBMP(mask);
   581                                 if (!mask.isNull()) {
   581                                 if (!mask.isNull()) {
   582                                     img = QImage(image.width(), image.height(), QImage::Format_ARGB32 );
   582                                     img = QImage(image.width(), image.height(), QImage::Format_ARGB32 );