Results 1 to 2 of 2

Thread: displaying png image for a given area..

  1. #1
    Join Date
    Dec 2006
    Posts
    123
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default displaying png image for a given area..

    hi everyone,


    i have a png image and i have a widget. i had set the size of widget as setMaximumSize(300,300 ).within this area i need to display the image within the coordinated (100,100). can anyone say me how to do that...?

    i did as follows:

    setPaletteBackgroundPixmap(QPixmap("qtlogo.png"));

    the image is displayed in the entire 300x300 area that too in rows and columns.and not within the coordinates i require.

    thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Posts
    128
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: displaying png image for a given area..

    Try QImage image(FILENAME) and at some point followed by QPainter::drawImage

    EDIT:
    Sorry, did not see your "Qt 3" part...but should be the same for that too ;-)

    See:
    Try QImage image(FILENAME) and at some point followed by QPainter::drawImage
    Last edited by camel; 17th January 2007 at 14:32.

Similar Threads

  1. how i can add image in my toolbar
    By jyoti in forum Qt Tools
    Replies: 7
    Last Post: 19th December 2006, 14:39
  2. Fast image drawing/scaling in Qt 3.3
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 10:45
  3. problem with the back ground image
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2006, 21:34
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 19:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.