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
7
votes
2 answers

Convert Mat to QPixmap

How can we convert directly cv::Mat to QPixmap without going through filename loading? I have made some research about it but no hints! As a first step, what I have tried is that I save the image, and then load it. But it's not what I want to have.
user2354422
  • 169
  • 1
  • 2
  • 8
7
votes
3 answers

Scaled QPixmap looks bad

I have the following widget: pixmap = QtGui.QPixmap(r'pics\cdaudio.png').scaled(100, 100) The image is scaled down, from 256x256. It looks pretty choppy: How can I scale it smoothly from within Qt?
iTayb
  • 12,373
  • 24
  • 81
  • 135
7
votes
3 answers

Load blob image data into QPixmap

I am writing a program using PyQt4 for front-end GUI and this program accesses a back-end database (which can be either MySQL or SQLite). I need to store some image data in the database and below is the Python code I use to import image files (in…
Bing Jian
  • 994
  • 3
  • 10
  • 18
6
votes
1 answer

Draw on top of image

I'm new to PyQt5 and I couldn't find any answers that worked for me about how to draw with QPainter on top of a loaded image (QPixmap("myPic.png")). I tried doing it within a paintEvent method but it didn't work. If I want to draw a line on top of…
Johan
  • 863
  • 3
  • 13
  • 28
6
votes
1 answer

QPainter::drawPixmap() doesn't look good and has low quality?

I'm trying to draw an icon(.png) inside a QWidget with QPainter::drawPixmap() : QPixmap _source = "/.../.png"; painter.setRenderHint(QPainter::HighQualityAntialiasing); painter.drawPixmap(rect(), _source); but in comparing to QLabel (for example)…
IMAN4K
  • 1,265
  • 3
  • 24
  • 42
6
votes
1 answer

Image assets won't load when using pytest

I'm developing a GUI with PySide and I create pixmap from images like this: PHONE_IMAGE_PATH = "resources/images/phone.png" self.phone_null = QtGui.QPixmap(GREY_DOT_PATH) self.phone_null = self.phone_null.scaledToWidth(20) This works perfectly when…
molundb
  • 484
  • 1
  • 4
  • 18
6
votes
3 answers

QGraphicsView scrolling and image scaling/cropping

I would like to have a background image in my QGraphicsView that is always scaled (and cropped if necessary) to the size of the viewport, without scrollbars and without scrolling with the keyboard and mouse. The example below is what I am doing to…
user298725
  • 63
  • 1
  • 1
  • 4
6
votes
3 answers

How to make qt qgraphicsview scale to not affect stipple pattern?

I draw few rectangles inside the QGraphicsView ; I use custom stipple pattern for these by creating a QBrush with my QPixmap. This gets displayed with the default zoom level as expected. When I call view->scale(), the rectangles show up bigger or…
Kaniyan
  • 75
  • 5
6
votes
2 answers

Blending two different images in Qt

My program generate 3 different images and I'd like to combine them using some opacity settings. First I have the raw image, which I already converted into a QPixmap to display it in a QGraphicsView. . Then with this image I make some calculation…
Leo
  • 1,129
  • 4
  • 23
  • 38
5
votes
4 answers

Shifting the hue of a QImage / QPixmap

I suppose this is more of a graphics manipulation question in general, but I'd like to accomplish this in Qt (c++). If I have an image - let's just say a circle on a transparent background - of a light gray color, is there any built-in functionality…
dajaffe
  • 855
  • 13
  • 34
5
votes
4 answers

threading: It is not safe to use pixmaps outside the GUI thread

I'm building a music player, that checks the status with SqueezePlay, which is a SqueezeBox controller app. To cut a long story short, I'm checking the status of Squeezeplay ever 5 seconds by using threading. If the song title changes, I let it…
FLX
  • 4,634
  • 14
  • 47
  • 60
5
votes
3 answers

Qt Screen Resolution Splash Screen

I have a splash screen image that I display with splash.showFullScreen() but it doesn't re size it to the screen resolution so it either comes out tiled or to large depending on the display. I have tried everything I can think of but nothing works.…
Gerharddc
  • 3,921
  • 8
  • 45
  • 83
5
votes
1 answer

How to draw a QPixmap with transparency

I've got a QPixmap and I would like to draw it on a QWidget. However, I would like to make it 50% transparent so that the background can be seen below. How can I do that?
laurent
  • 88,262
  • 77
  • 290
  • 428
5
votes
4 answers

is there any way to insert QPixmap object in html?

Simple situation: I have an object, which has a QPixmap member. Object first created (pixmap is null now), then pixmap readed from data base and inserted in object. I need to insert that pixmap in html code () and display that html code in a QLabel…
Pie_Jesu
  • 1,894
  • 3
  • 16
  • 30
5
votes
4 answers

What is the best way to get the hash of a QPixmap?

I am developing a graphics application using Qt 4.5 and am putting images in the QPixmapCache, I wanted to optimise this so that if a user inserts an image which is already in the cache it will use that. Right now each image has a unique id which…
Phil Hannent
  • 12,047
  • 17
  • 71
  • 118
1
2
3
33 34