I want to set the size of pixmap. The code is defined below.
Qt Code:
painter->drawPixmap(pointf[i], pix);To copy to clipboard, switch view to plain text mode
It is showing a bigger image.
How to set the size?
I want to set the size of pixmap. The code is defined below.
Qt Code:
painter->drawPixmap(pointf[i], pix);To copy to clipboard, switch view to plain text mode
It is showing a bigger image.
How to set the size?
You can either
1) Scale the pixmap befor drawing it, or
2) Use a version of drawPixmap that will do the scaling:
void QPainter::drawPixmap ( const QRectF & target, const QPixmap & pixmap, const QRectF & source )
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
Note: The pixmap is scaled to fit the rectangle, if both the pixmap and rectangle size disagree.
sonulohani (4th June 2012)
this one works, the one i am showing below--------->
Qt Code:
int x=points->x(); int y=points->y(); painter->drawpixmap(x,y,width,height,pixmap);//here replace the width and height with the pixmap width and height that you want to resize.To copy to clipboard, switch view to plain text mode
And then you will get the image with the size that you've configured.
Bookmarks