[Qt-interest] load jpg files

Patric userqt at gmail.com
Tue Sep 1 15:30:54 CEST 2009


I also had problems with jpeg files. I was able to upload them into my application, and use them actually, but only from machine with QT installed on it. 
I realized this when I created installation package and tried to run my program on different machine. I did not figured out why it's not working with jpeg files. 

Try to use png instead of jpeg. 

Regards, 
Patric
  ----- Original Message ----- 
  From: Yuvaraj R 
  To: Eirik Ulvik 
  Cc: qt-interest at trolltech.com 
  Sent: Tuesday, September 01, 2009 4:24 PM
  Subject: Re: [Qt-interest] load jpg files


  Eirik 

  I too faced same issue.

  if we load the jpg file to resource files.. we are not able to use it .Why ?

  Can u please explain us ?

  Thanks

  Yuvaraj Ragupathi



  On Tue, Sep 1, 2009 at 1:59 PM, Eirik Ulvik <eiriku at simsurgery.com> wrote:



    RPREMANAND RPREMANAND skrev: 


      Hi,
         I tried to load JPEG files in my application using
      void paintEvent(QPainterEvent * event){
      QImage *img= new QImage(tr("/images/16.jp"),Qt::Format_RGB32);
      QPixmap *pmp=new QPixmap(tr("/images/16.jpg")) ;
      QPainter p(this);

      p.drawPixmap(0,0,50,50,*pmp );

      }
      I also used img->load(tr("/images/16.jpg"))
      pmp->load(tr("/images/16.jpg"));

      i also did

      drawImage(img);

      Im unable to embed the resource in my application.

      I faced failure in all my attempts .
      Pls help in this.


      Thanks in advance,

      Premanand Rangasamy.
      -- 
      Prem

--------------------------------------------------------------------------
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
  If the images are resources you should use the resurces string format eg. ":/images/16.jpg". 

    Eirik


    _______________________________________________
    Qt-interest mailing list
    Qt-interest at trolltech.com
    http://lists.trolltech.com/mailman/listinfo/qt-interest






------------------------------------------------------------------------------


  _______________________________________________
  Qt-interest mailing list
  Qt-interest at trolltech.com
  http://lists.trolltech.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090901/af31a645/attachment.html 


More information about the Qt-interest-old mailing list