[Kde-games-devel] TR: cmp-toolkits

Burkhard Lehner kde-games-devel@mail.kde.org
Fri, 12 Apr 2002 18:05:05 +0200


Hi, Ruben!

I'm not absolutly sure, but if it is a QPixmap that is taken by the QCanvas, 
then I think you have the same problem with Qt:
A QPixmap is managed by the X server, and has bit depth of the current 
visual. So if the graphic card is in TrueColor mode (24 bit depth), the 
QPixmap will have that depth. The only exception is a QBitmap. It is a pixmap 
with depth 1 bit.

QImage is different. It can hold a bit depth of 1, 8 or 32 bit per pixel.But 
QImage is slow when being displayed on the screen. So if you have to show a 
picture very often, QImage might be too slow.

A solution could be to split the complete image into smaller pieces, stored 
in QImage objects, and to translate only those pieces that have to be shown 
to QPixmap objects. This isn't done by QCanvas automatically, so you would 
have to implement this on your own.

Also keep in mind that the data of QPixmap objects is stored in the X server. 
It could be that the X server has a memory limit, so your program could fail 
because of this if you try to allocate QPixmaps that are too big. QImage 
objects are stored in YOUR programs memory space, so it is only limited by 
the virtual memory of your operating system.

Hope this helps,
	Burkhard


Am Freitag, 12. April 2002 14:12 schrieb Philippe FREMY:
> I don't have time to look at the answer by myself.
> Do you guys have an idea ?
>
> > -----Message d'origine-----
> > De : Ruben Oliveira [mailto:rsolivei@ualg.pt]
> > Envoyé : jeudi 11 avril 2002 20:20
> > À : Philippe FREMY
> > Objet : Re: cmp-toolkits
> >
> >
> > Hi Philippe FREMY
> >
> > I have a question that maybe you can answer me.
> > I have a problem with pygtk and i'm starting to see if a pyQt
> > implementation is better. The problem is that i have a
> > grayscale pixmap
> > that uses about 80 Mb because it's about 10000x8000 and I
> > have to display it
> > in the background and then draw some polygons or text, so i'm using
> > gnomecanvas
> > the problem is that havoc penington says that the canvas
> > images have  to
> > be always RGB
> > and because of that i have to use a minimum of 250 Mb of RAM. He also
> > says that in
> > the future the Canvas will acept other bit depths. :(
> > I know that I can load pixmap into a QCanvas and i know that there is
> > a QBitmap in Qt so maybe you know what's the implementation of the Qt
> > libraries and could give me an advice to not waste so much memory.
> > Is it possible to use a grayscale pixmap in QCanvas ?
> >
> > Merci,
> > Ruben Oliveira
>
> _______________________________________________
> kde-games-devel mailing list
> kde-games-devel@mail.kde.org
> http://mail.kde.org/mailman/listinfo/kde-games-devel

-- 
_________________________________________________________
Burkhard Lehner                         Tel: (0631) 10363
Pfaffenbergstraße 101                  Fax: (0631) 3105215
67663 Kaiserslautern                   EMail: Burkhard.Lehner@gmx.de
            WWW: http://www.burkhardlehner.de/