From kde-core-devel Tue Oct 31 00:43:37 2000 From: Antonio Larrosa Date: Tue, 31 Oct 2000 00:43:37 +0000 To: kde-core-devel Subject: Re: alpha icons X-MARC-Message: https://marc.info/?l=kde-core-devel&m=97295302227445 Dirk Mueller escribi=F3: > = > On Mon, 30 Okt 2000, Antonio Larrosa wrote: > = > > Opinions ? Anyone objecting me to change each icon in a kiconview > > to be stored as a QImage instead of a QPixmap ? > = > Yes. why don't you use the QImage saving in QPixmap ? > setOptimization(Full) saves an QImage additionally to the pixmap. > = Hmm, every day I learn a new method :) But wouldn't that mean that it would take "double" space ? Otoh, it would be (much) easier to be able to enable/disable alpha blending and those kind of things (if it works as I think it does) Also, we would rely on QImage img(somefile); QPixmap xpm=3Dimg; QImage img2=3Dxpm.convertToImage(); to set img2 to the same image than img (which is not the case with the default Optimization). I'll try to test if that works. > the image -> pixmap conversion is very slow. we shouldn't default to it= =2E > = Well, _each_ icon you load is loaded as an image and then converted to a pixmap except for alpha icons, that, right now are loaded as QImages, stored as QImages and converted to QPixmaps at paint time (inside QPainter::drawImage). I planned to do a cache with QPixmaps so that the conversion is only done once for alpha icons (after blending) but if your idea about setOptimization works ok, I'll rethink about all this and look for a better way to do it. I'll try to optimize more for the alpha-disabled case even if that means that it will take a bit more resources when the user selects to use alpha icons. Greetings, -- Antonio Larrosa Jimenez KDE core developer antlarr@arrakis.es larrosa@kde.org http://www.arrakis.es/~rlarrosa KDE - The development framework of the future, today.