Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, December 2007
QImage and setPixel()


Message 1 in thread

I am using Qt 4.2(with Debian Etch, NVidia Quadro FX550) and 
4.3(with Debian Lenny, Nvidia Quadro NVS 140M and Windows XP, GeForce7600).

I made a kind of mesh image with SetPixel on QImage ( background is filled
with transparent )

QImage?::QImage..(int sx, int sy) :QImage(sx,sy,
QImage::Format_ARGB32_Premultiplied)
{
    QPainter painter(this);
    painter.setCompositionMode(QPainter::CompositionMode_Source);
    painter.fillRect(0,0, m_iSizeX, m_iSizeY, Qt::transparent);
    
    for(int ix=0; ix < m_iSizeX; ix+=2)
    {
      for(int iy=0; iy < m_iSizeY; iy+=2)
      {                      
       ?
                setPixel(ix, iy, qRgba(r,g,b,250));
       }
   }
    painter.end();
}

And this QImage is overlayed on other QImage(QImage::Format_ARGB32)
This is the part of my paintEvent().
        painter.setCompositionMode(QPainter::CompositionMode_Source);
        painter.drawImage(m_iPosX, m_iPosY, *m_pImage1, 0,0, m_iSizeX,
m_iSizeY);
        painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
        painter.drawImage(m_iPosX, m_iPosY, *m_pImage2, 0,0, m_iSizeX,
m_iSizeY);

m_pImage1 is bottom image. And m_pImage2 is the image which is made with the
above code.
Qt 4.2 with Debian Etch  works fine. It shows correct pixel color of
m_pImage2.
But Qt 4.3 seems like not working. It shows always black dots.

Do you have any idea? Is it possible it is caused by Graphic hardware or
some OS configuration?
Do I need some configuration adjust on Qt 4.3?


Samuel B. Park  - Research Associate of Sohn Laboratory.
Case Western Reserve University. School of Medicine. Dept. Rad. Oncology
http://rophys.meds.case.edu

--
 [ signature omitted ]