Results 1 to 6 of 6

Thread: Bitmap border

  1. #1
    Join Date
    Mar 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Bitmap border

    I have made a simple speedometer. I render the needle and use a bitmap to view the meter. It looks very good, but the bitmaps border to the left is slightly visible. Is there a way to smooth out or hide the border?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bitmap border

    Thers some option of setRendering to Anti Aliasing I guess...
    dont remember the function exxactly... search for anti aliasing the QtAssistant

  3. #3
    Join Date
    Mar 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Bitmap border

    I use...

    painter.setRenderHint(QPainter::Antialiasing, true); // Does not help!!!

    Thank you for your input anyways...

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bitmap border

    can u show us a snapshot ??

  5. #5
    Join Date
    Mar 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Bitmap border

    Qt Code:
    1. void SpeedoMeter::paintEvent(QPaintEvent *event)
    2. {
    3.  
    4. QPixmap pixmap("speedo.bmp");
    5. QPainter painter(this);
    6.  
    7. painter.setRenderHint(QPainter::Antialiasing, true);
    8.  
    9. painter.drawPixmap(10, 10, pixmap);
    10.  
    11. .
    12. .
    13. .
    14.  
    15. }
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Mar 2008
    Posts
    57
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Bitmap border

    I'll post a picture of my problem. Please take a look at it...
    Attached Images Attached Images

Similar Threads

  1. Showing QWidget border around the window
    By maverick_pol in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2008, 21:14
  2. QPrinter on QGraphicsScene Border Problem
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2007, 16:49
  3. How to set the BORDER COLOR of QDialog?
    By ashukla in forum Qt Programming
    Replies: 6
    Last Post: 13th November 2007, 17:09
  4. border color is wrong with "plastique" style in Qt4.2.3
    By alfa_wu in forum Qt Programming
    Replies: 2
    Last Post: 30th April 2007, 05:27
  5. How to create a movable border between two widgets?
    By Teuniz in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2007, 09:45

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.