PDA

View Full Version : Qt 3.3.8 pixmap to/from image error



ksierens
14th April 2008, 18:05
I am trying to create a new icon set from an existing one by smooth scaling each of it’s pixmaps. When I try to do this, I get an assertion when I am trying to convert the image back to a pixmap just before setting the new pixmap in the iconset. I looked into it further and found that even a simple round-trip to and from an image is not working, and I receive the following assertions:


ASSERT: "hBitmap" in kernel\qpixmap_win.cpp (117)
ASSERT: "data->realAlphaBits" in kernel\qpixmap_win.cpp (118)

Here is some sample code that shows what I was trying to do:


QIconSet *dest = new guiIconSet;

for ( int size = 0 ; size < 2 ; size++ )
{
for ( int mode = 0 ; mode < 3 ; mode++ )
{
for ( int state = 0 ; state < 2 ; state++ )
{
// Get the image from the source iconsets pixmap
srcImg = pixmap((QIconSet::Size )size, (QIconSet::Mode )mode, (QIconSet::State )state);

if ( ! srcImg.isNull() )
{
guiPixmap destPm;

// Get the dest pixmap from the dest image
destPm = srcImg;

if ( ! destPm.isNull() )
dest->setPixmap(destPm, (QIconSet::Size )size, (QIconSet::Mode )mode, (QIconSet::State )state);
}
}
}
}
Thanks in advance.

ChristianEhrlicher
15th April 2008, 06:46
First 3.3.8 is very old. Second - the windows version is comercial only so you (hopefully) have a commercial license -> ask tt