Results 1 to 2 of 2

Thread: Fast image drawing/scaling in Qt 3.3

  1. #1
    Join Date
    Jun 2006
    Posts
    11
    Thanked 4 Times in 4 Posts

    Default Fast image drawing/scaling in Qt 3.3

    I'm working on an application which plays one or more sets of images as an animation. Currently I load the image to be drawn into a QPixmap and use bitBlt() to copy the image onto a QWidget used as a canvas. When playing two sets I bitBlt() the second image onto the same canvas but to the left of the first image.

    Now I'm etending the functionality of the application to handle a dynamic number of image-sets, be able to scale individual images and scale the results. The customer will be given more freedom of where each set will be placed in relation to other sets and how large each set will be (in pixels). This means that I'll have to be able to scale individual images. In addition the customer will be able to specify a max-size of the final image, which means that I'll have to be able to scale the final image (the result of bitBlt()-ing the images onto a new image/canvas.

    Since I can not scale an image using the QPixmap I would have to use a QImage, however a QImage can not bitBlt() to a QPaintDevice/QWidget (my canvas) and in the documentation it says that conversion between QImage and QPixmap is slow. I'm wondering how slow and if anyone has any advice of a perhaps better solution (I've been thinking about using QGL but have not investigated it yet)?

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Fast image drawing/scaling in Qt 3.3

    There is an example called showimg in Qt 3 examples. I think you need something similar to that. If you resize the window in that example the image resizes itself to fit the window. Even in that example there is some kind of conversion happening and its pretty ok.

Similar Threads

  1. problem with the back ground image
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2006, 21:34
  2. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  3. Saving already opened image ...
    By Godlike in forum Newbie
    Replies: 14
    Last Post: 28th March 2006, 21:17
  4. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 19:01
  5. reading in image from 24bit char*
    By cbeall1 in forum Qt Programming
    Replies: 2
    Last Post: 20th February 2006, 00:09

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.