QTfrontend/net/hwmap.cpp
changeset 10162 38dbf26475d8
parent 10161 c092f92aee23
child 10166 4be4a3302ff8
equal deleted inserted replaced
10161:c092f92aee23 10162:38dbf26475d8
    84         p.fillRect(pxres.rect(), linearGrad);
    84         p.fillRect(pxres.rect(), linearGrad);
    85         p.drawPixmap(0, 0, px);
    85         p.drawPixmap(0, 0, px);
    86 
    86 
    87         emit HHLimitReceived(buf[128 * 32]);
    87         emit HHLimitReceived(buf[128 * 32]);
    88         emit ImageReceived(px);
    88         emit ImageReceived(px);
       
    89     } else if (readbuffer.size() == 128 * 256 + 1)
       
    90     {
       
    91         QVector<QRgb> colorTable;
       
    92         colorTable.resize(256);
       
    93         for(int i = 0; i < 256; ++i)
       
    94             colorTable[i] = qRgba(255, 255, 0, i);
       
    95 
       
    96         const quint8 *buf = (const quint8*) readbuffer.constData();
       
    97         QImage im(buf, 256, 128, QImage::Format_Indexed8);
       
    98         im.setColorTable(colorTable);
       
    99 
       
   100         QPixmap px = QPixmap::fromImage(im, Qt::ColorOnly);
       
   101         QPixmap pxres(px.size());
       
   102         QPainter p(&pxres);
       
   103 
       
   104         p.fillRect(pxres.rect(), linearGrad);
       
   105         p.drawPixmap(0, 0, px);
       
   106 
       
   107         emit HHLimitReceived(buf[128 * 256]);
       
   108         emit ImageReceived(px);
    89     }
   109     }
    90 }
   110 }
    91 
   111 
    92 void HWMap::SendToClientFirst()
   112 void HWMap::SendToClientFirst()
    93 {
   113 {