[PyKDE] Displaying an image

Jim Bublitz jbublitz at nwinternet.com
Tue Aug 17 02:45:47 BST 2004


On Monday 16 August 2004 17:56, Matthew Singer wrote:
> This got me an image, but the color map is all wrong.  What else so I have
> to do?

I don't know - your code works fine here.

I'm just shooting from the hip here, but on some formats there's a pixel 
(0,0 ?) that's used to specify the color that represents transparency. Also, 
it's possible your jpg isn't a format Qt likes. You could try either a 
different jpg or converting it to xpm or png (gimp, for example, or probably 
xv will do that).

I assume by "color map wrong" you mean that the colors in the image you 
display are different than colors are supposed to be?

Jim

>
>     q = QWidget()
>     view = QLabel(q)
>     pixmap = QPixmap()
>     pixmap.load("myimage.jpg")
>     view.resize(pixmap.size())
>     q.resize(pixmap.size())
>     view.setPixmap(pixmap)
>     view.show()
>     q.show()




More information about the PyQt mailing list