Qt-interest Archive, June 2007
Converting QImage to QPixmap
Message 1 in thread
Hi,
I have a QImage of 1280x933 pixels and convert it to a QPixmap with
QPixmap::fromImage(). This takes 1.1 seconds when the application does not
run on my X server machine.
The time to draw the pixmap on screen is not measurable after the pixmap
creation.
Is there a way to speed this up?
Christoph
--
[ signature omitted ]
Message 2 in thread
>Hi,
>
>I have a QImage of 1280x933 pixels and convert it to a QPixmap with
>QPixmap::fromImage(). This takes 1.1 seconds when the application does not
>run on my X server machine.
>
>The time to draw the pixmap on screen is not measurable after the pixmap
>creation.
>
>Is there a way to speed this up?
>
>Christoph
Did you try QPainter and drawImage() ?
QImage myimage; //defined somewhere else
QPixmap pixmap(1280,933);
QPainter painter(&pixmap);
painter.drawImage(0,0,myimage);
Just an idea thought. I usually use fromImage as it works fast enough on my
machine
_________________________________________________________________
Sie suchen E-Mails, Dokumente oder Fotos? Die neue MSN Suche Toolbar mit
Windows-Desktopsuche liefert in sekundenschnelle Ergebnisse. Jetzt neu!
http://desktop.msn.de/ Jetzt gratis downloaden!
--
[ signature omitted ]
Message 3 in thread
QImage resides in local memory, while QPixmap is stored at the X server.
The delay you're seeing here comes from uploading the image to the X
server.
i'm afraid there is not much you can do about it. get a faster
connection or try using smaller images ;-) or create your pixmaps during
startup. (of course this only works for images that aren't changed
dynamically)
Cheers,
Peter
> Hi,
>
> I have a QImage of 1280x933 pixels and convert it to a QPixmap with
> QPixmap::fromImage(). This takes 1.1 seconds when the application does
not
> run on my X server machine.
>
> The time to draw the pixmap on screen is not measurable after the
pixmap
> creation.
>
> Is there a way to speed this up?
>
> Christoph
--
[ signature omitted ]