[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

jpegs with qt and ruby

StillLifeWood

1/25/2005 11:07:00 AM

Hi, does anyone have a simple example of putting a jpeg image on a form
using QImage in Qt.

thanks in advance

David

3 Answers

Richard Dale

1/25/2005 11:20:00 AM

0

StillLifeWood@aol.com wrote:

> Hi, does anyone have a simple example of putting a jpeg image on a form
> using QImage in Qt.
I think you'd use Qt::Pixmap/QPixmap and a Qt::Label for that, rather than
Qt::Image, eg:

blankPM = Qt::Pixmap.new("rbtestimage.jpeg")
pmLbl = Qt::Label.new("", nil)
pmLbl.pixmap = blankPM

Qt::Images are for when you actually want to manipulate the image, and
Qt::Pixmaps are for displaying them.

-- Richard

Alexander Kellett

1/25/2005 12:07:00 PM

0

try qlabel with a qpixmap
good luck :)

http://lists.suse.com/archive/suse-programming-e/2004-Sep...

Alex

On Jan 25, 2005, at 12:10 PM, StillLifeWood@aol.com wrote:

> Hi, does anyone have a simple example of putting a jpeg image on a form
> using QImage in Qt.
>
> thanks in advance
>
> David
>



StillLifeWood

1/26/2005 6:40:00 AM

0

Thanks guys QPixmap/Qlabel is the answer, worked first time.




Richard Dale wrote:
> StillLifeWood@aol.com wrote:
>
> > Hi, does anyone have a simple example of putting a jpeg image on a
form
> > using QImage in Qt.
> I think you'd use Qt::Pixmap/QPixmap and a Qt::Label for that, rather
than
> Qt::Image, eg:
>
> blankPM = Qt::Pixmap.new("rbtestimage.jpeg")
> pmLbl = Qt::Label.new("", nil)
> pmLbl.pixmap = blankPM
>
> Qt::Images are for when you actually want to manipulate the image,
and
> Qt::Pixmaps are for displaying them.
>
> -- Richard