Results 1 to 2 of 2

Thread: Image Size Not Right

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Image Size Not Right

    Hi,
    I have a png image I am trying to display on the full width and height of my lcd (800x480).
    I have a QGraphicsScene inside a QGraphicsView, and I am using a QGraphicsPixmapItem in the scene.
    The png image is not displaying 800x480, instead it is scaled slightly by a few pixels. ( approximately 797x478). I can see the background image outline around the image, I want to cover the whole screen. I check the size of the image and it is 800x480. If I use that same image in a splash screen or main background it covers the whole screen.
    I am converting to 16bit because of my display. Anyways, with or without the conversion it is the same
    Using QtEmbedded 4.4.1
    LCD is 16bit 800x480
    Image specifications, I used the debug to show these
    Width=800
    Height=480
    Format=QImage::Format_RGB32
    DotsPerMeterX,Y = 2835
    Depth=32

    Any suggestions?

    Thanks.


    Qt Code:
    1. QRectF windowBoundary(0 , 0, 800, 480);
    2. extFuncKeyWinItems = new QGraphicsScene(windowBoundary, parent);
    3. QImage extIcon(EXTFUNCKEYWINBKGICON);
    4. extIcon.convertToFormat(QImage::Format_RGB16);
    5. QGraphicsPixmapItem *extendedFuncKeyWindow = new QGraphicsPixmapItem QPixmap::fromImage(extIcon));
    6. qDebug() << extIcon.height() << extIcon.width() << "EXTENSIONWINDOW";
    7. extendedFuncKeyWindow->setOffset(0,0);
    8. extendedFuncKeyWindow->setZValue(0);
    9. extFuncKeyWinItems->addItem(extendedFuncKeyWindow);
    To copy to clipboard, switch view to plain text mode 
    Last edited by QbelcorT; 5th March 2009 at 08:19.

Similar Threads

  1. QLabel size, for image display
    By C167 in forum Qt Programming
    Replies: 13
    Last Post: 25th October 2013, 16:09
  2. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 15:36
  3. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  4. how to draw a image of size 600x400
    By sar_van81 in forum Qt Programming
    Replies: 2
    Last Post: 12th March 2007, 11:11
  5. [QT4] QtextBrowser and image size (win)
    By sebgui in forum Qt Programming
    Replies: 0
    Last Post: 28th March 2006, 21: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
  •  
Qt is a trademark of The Qt Company.