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)
ASSERT: "hBitmap" in kernel\qpixmap_win.cpp (117)
ASSERT: "data->realAlphaBits" in kernel\qpixmap_win.cpp (118)
To copy to clipboard, switch view to plain text mode
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);
}
}
}
}
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);
}
}
}
}
To copy to clipboard, switch view to plain text mode
Thanks in advance.
Bookmarks