Questions tagged [qpixmap]

The QPixmap class, part of the Qt framework, is an off-screen image representation that can be used as a paint device.

QPixmap class is one of Qt classes for handling image data. It is designed and optimized for showing images on screen.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

499 questions
100
votes
5 answers

What is the difference between QImage and QPixmap?

I do not understand what is the difference between QImage and QPixmap, they seem to offer the same functionality. When should I use a QImage and when should I use a QPixmap?
Mr.Tu
  • 2,633
  • 8
  • 31
  • 47
24
votes
3 answers

PyQt showing video stream from opencv

Try to link PyQt and Opencv video feed, can't understand how to apply while loop for continuously streaming video. It just take a still picture.Please can anyone help to solve the problem. PtQt=5 Python=3.6.1 class App(QWidget): def…
Taimur Islam
  • 960
  • 2
  • 11
  • 25
24
votes
1 answer

How to save a QPixmap Object to a file?

I'm having trouble reading and writing QByteArray data to a file. My goal is to save QPixmap data into a QByteArray and save that QByteArray to a file (with the ability to read this QByteArray back from the file and into a QPixmap). I want to use…
Alex Wood
  • 821
  • 3
  • 12
  • 27
19
votes
2 answers

How to use QPainter on QPixmap

I'm a newbie to Qt/Embedded. I want to use QPainter to draw stuff on a QPixmap, which will be added to QGraphicsScene. Here is my code. But it does not show the drawings on the pixmap. It shows only the black pixmap. int main(int argc, char **argv)…
manmatha.roy
  • 577
  • 1
  • 9
  • 22
15
votes
2 answers

How to create screenshot of QWidget?

I work at my homework in Qt Creator, where I paint to QWidget and I need to save some part of this QWdiget. I tried to solve this problem: QPixmap pixmap; pixmap.copy(rectangle); // rectangle is part of QWidget, which I need to save …
avalagne
  • 359
  • 3
  • 7
  • 15
14
votes
5 answers

QImage/QPixmap size limitations?

Are there any known size/space limitation of QPixmap and/or QImage objects documented? I did not find any useful information regarding this. I'm currently using Qt 4.7.3 on OSX and Windows. Particulary I'm interested in: Width/Height limits? Limits…
grefab
  • 1,997
  • 2
  • 22
  • 32
13
votes
1 answer

Qt resize image with best quality

Can anyone help me resize an image in qt without making the image pixelated. Here's my code. the result is not as good as the original quality..thanks... QImage img(name); QPixmap pixmap; pixmap =…
James Seva
  • 139
  • 1
  • 2
  • 7
12
votes
1 answer

Qt: Drawing high DPI QPixmaps

I have written application that draws two smiling faces: First one is painted directly on QWidget: void DirectFace::paintEvent(QPaintEvent *ev) { QPainter painter(this); paintFace(painter); } Second one is painted on a QPixmap, which in…
12
votes
3 answers

Getting a HBITMAP from a QPixmap in QT5 (Windows)

Now that QPixmap::toWinHBITMAP() has been deprecated, I can't find a way to get an HBITMAP from a QPixmap (or QImage). Googling, I found there's a function called qt_pixmapToWinHBITMAP() which seems would do what I need, but I can't find what module…
Gato
  • 671
  • 5
  • 15
11
votes
3 answers

Load QPixmap from QByteArray in Qt?

I have a byte array with the contents of an image (in png/bmp or some other format). How can I load it into a QPixmap?
Bokambo
  • 4,204
  • 27
  • 79
  • 130
11
votes
4 answers

QPixmap and SVG

How would you suggest to handle svg with QPixmap? The construct QPixmap(":/myfile.svg"); then call of scaled() does not work. The QPixmap gets pixelised. Thx.
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
10
votes
1 answer

(Qt C++) Resize pixmap and KEEP pixelation?

In my project I have a QLabel that I change the pixmap frequently like this: ui->frameLabel->setPixmap(slot_pic[blockId[currentSlot]][damageId[currentSlot]]); slot_pic is simply a 2d map. So you can look at it clearer like…
mrg95
  • 2,371
  • 11
  • 46
  • 89
9
votes
3 answers

Convert PyQt5 QPixmap to numpy ndarray

I have pixmap: pixmap = self._screen.grabWindow(0, self._x, self._y, self._width, self._height) I want to convert it to OpenCV format. I tried to convert it to numpy.ndarray as…
ingvar
  • 4,169
  • 4
  • 16
  • 29
9
votes
1 answer

Convert QVideoFrame straight to QPixmap

I've used QVideoProbe to access camera frames. My platform is Android. I've converted each camera frames to QImage and then pixmap and show on QLabel. My problem is this process is very slow. frames are shown very slowly. Can I convert QVideoFrame…
Hasti Ranjkesh
  • 643
  • 10
  • 26
8
votes
2 answers

Qt qrc resource path doesn't work

I would like to show an image within a QLabel widget. The image is located in the folder ./images/ relative to the resource.qrc file and included like the this: image.png
Xear
  • 407
  • 1
  • 5
  • 15
1
2 3
33 34