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
3
votes
4 answers

Convert IplImage to Qpixmap

How do we convert IplImage to a QPixmap or QImage? If the only answer is save the Iplimage then load it to the QPixmap, then how do we do that?
hamza
  • 2,714
  • 3
  • 19
  • 14
3
votes
1 answer

QPixmap / QPainter showing black window background

I am following an example from the PyQt5 book by Martin Fitzpatrick. When I run the following code, the background is black and the line is not drawn: import sys from PyQt5 import QtCore, QtGui, QtWidgets, uic from PyQt5.QtCore import Qt class…
Joe
  • 80
  • 2
  • 10
3
votes
1 answer

How to add an image in pyqt qdock widget

I am trying to create a image viewer using pyqt. What i am trying is to create a qdockwidget to display the image. I have created the qPixmap objecte and tried to add it as a widget in qdockwidget. from PyQt5 import QtWidgets, QtGui from…
3
votes
1 answer

How to interactively draw points onto a Pixmap that is on a QLabel in PyQT

I am building a small GUI interface and I have a QLabel that draws images from a directory onto itself by setting them as the pixmap. I want the user to be able to interactively click points on this pixmap and have a small green 'x' appear at the…
ely
  • 74,674
  • 34
  • 147
  • 228
3
votes
1 answer

show matplotlib imshow output in Qt

I have a 2D numpy array of type np.float64, and I want to show it as an image in a QLabel (or any other valid way): self.img = np.rot90(get_my_data()) # this line returns a 2D numpy array of type np.float64 self.qimg = QtGui.QImage(self.img,…
catfour
  • 119
  • 3
  • 10
3
votes
1 answer

PyQt: Create QPixmap with alpha channel and not premultiplied color channels

I would like to create a QPixmap to draw on using a QPainter. The QPixmap should support transparency without using premultiplied color channels. Currently I do this by creating a QPixmap with the desired dimensions and filling it with a QColor that…
bp45738
  • 31
  • 1
  • 2
3
votes
1 answer

PyQt how to convert a QPainterPath to a QPixmap?

I've been searching online and couldn't find a good way to do this. I need to convert a QPainterPath to a QPixmap. Is this possible? If yes, how would this be done? Thanks!
3
votes
1 answer

I am not using QPixmap, in PyQt. but I get QPixmap: It is not safe to use pixmaps outside the GUI thread in PyQt

I am using PyQt for a project. But not all of a sudden I am getting an error: QPixmap: It is not safe to use pixmaps outside the GUI thread in PyQt I am not using QPixmap anywhere in my code... please help. class itemCheckBtn(QtGui.QDialog): qApp…
tejzpr
  • 945
  • 8
  • 19
3
votes
1 answer

How to load an image with QLabel in PySide2

I'm a beginner in coding and python. I read that tkinter is a bit to "basic" if you want to develop an application which is a a bit more complicated and PyQt is problematic for licencing. This is why I chose PySide2 in order to develop this kind of…
ecjb
  • 5,169
  • 12
  • 43
  • 79
3
votes
1 answer

Generate QPixmap in non GUI thread

In my project I need to generate thousands of unique QPixmap variables based on data collected. This data is being collected in worker thread because it can be a little slow. At the end of the thread's work, it will create one big image containing…
mrg95
  • 2,371
  • 11
  • 46
  • 89
3
votes
2 answers

How to draw darkened QPixmap?

I'm looking for a fast and effective way to draw a QPixmap with QPainter, but have the pixmap appear darker then normal. Is there some sort of filter or effect that can be applied to either the QPixmap or QPainter while drawing to create this…
Griffort
  • 1,174
  • 1
  • 10
  • 26
3
votes
1 answer

How to add both an image and text to a QLabel

I have a QHBoxLayout with a QLabel in it, and I'm trying to get both an icon and window title text in the QLabel. Is that possible? Or even to add the icon directly to the QHBoxLayout, so that is is laying just before the window title text? Here is…
Maxwe11
  • 97
  • 1
  • 1
  • 9
3
votes
1 answer

C++ opencv Mat to QPixmap errors

I am attempting to write a function which puts a greyscale OpenCv Mat into a Qt QPixmap, then into a QLabel. A third of the time it works. A third of the time, it skews the image... becomes The rest of the time, the program crashes, specifically…
poppy
  • 247
  • 2
  • 15
3
votes
1 answer

How to efficiently draw images using QPainter?

I want to draw a custom made Pixmap on QLabel. I have to show the image in a circle and the widget has animation on mouse hover (eg, outline color highlight, and property animation too). I tried drawing the entire image inside paintEvent of the…
vaishak
  • 63
  • 7
3
votes
2 answers

How to rotate an image around its centre in QT QWidgets C++?

I am trying to rotate am image around its origin(center) in QT using QWidgts in C++. I experimented a lot of things here, but no matter what I do, the image keeps rotating around some arbitrary position I have no clue of. Kindly, help me out here. I…
Sam
  • 113
  • 5
  • 13