[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: alpha icons
From:       Antonio Larrosa <antlarr () arrakis ! es>
Date:       2000-10-31 0:43:37
[Download RAW message or body]

Dirk Mueller escribió:
> 
> 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=img;
QImage img2=xpm.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.
> 

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.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic