Thursday, November 20th 2008, 11:34am UTC

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, May 14th 2008, 7:47am

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?
  • Go to the top of the page

ramandeep

Trainee

Posts: 107

Location: India

Occupation: embedded software

2

Wednesday, May 14th 2008, 12:16pm

RE: Bitmap border

I dont quite understand ur question....can u elaborate a bit?
  • Go to the top of the page

3

Wednesday, May 14th 2008, 1:48pm

Well I'll try. The meter bitmap has a black background (The meter itself is yellow) and its shape is 64X64. If the widget the bitmap is placed upon is white the bitmaps border will be very visible. No I have a black background widget and the left border of the bitmap is slightly visible.

I simply want the bitmap to blend in with the black background widget.
  • Go to the top of the page

4

Wednesday, May 14th 2008, 6:46pm

I'll post a picture of my problem. Please take a look at it...
Lasse has attached the following file:
  • Go to the top of the page

5

Wednesday, May 14th 2008, 6:57pm

could you post your bitmap and the code to put it in a widget
Nicolas
  • Go to the top of the page

6

Wednesday, May 14th 2008, 7:37pm

The speedoMeter inherits QWidget and is simply put on a black QWidget window.

This is the code for the bitmap part...

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void SpeedoMeter::paintEvent(QPaintEvent *event)
      {
        
          QPixmap pixmap("speedo.bmp");

          QPainter painter(this);
   
          painter.setRenderHint(QPainter::Antialiasing, true);
      
          painter.drawPixmap(10, 10, pixmap);

          .
          .
          .
 
      }
  • Go to the top of the page

7

Thursday, May 15th 2008, 8:47am

the bitmap too, please
Nicolas
  • Go to the top of the page

Rate this thread