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

set an image to a qt pushbutton

I tried to set an image to a Qt pushbutton using this widely known code. QPixmap *pic = new QPixmap(":/images/logo.png"); QIcon *icon = new QIcon(*pic); ui->pushButton->setIcon(*icon); ui->pushButton->setIconSize(QSize(pic->width(),…
Lizzy
  • 2,033
  • 3
  • 20
  • 33
0
votes
1 answer

Choppy scrolling of QPixmap using Qt Animation Framework

I created QPropertyAnimation and connected it to my SonogramWidget that scroll a long picture vertically on animation events. The 'long picture' is composed of 100 pre-calculated QPixmap objects 1024x128 placed one after another vertically. They…
pavelkolodin
  • 2,859
  • 3
  • 31
  • 74
0
votes
1 answer

Loading an image onto a graphics view from a byte array

I have some problem with loading image data from raw bmp data loaded previously from a big game file. I'm sure the data is OK, as the else branch is not reached, but the image is not shown. Maybe I'm not using loadFromData in a correct way? Anyone…
kosto
  • 84
  • 7
0
votes
1 answer

Paint QPixmap into a circle?

I can paint a QPixmap just fine: QPainter painter; painter.drawPixmap(x, y, w, h, my_pixmap); And I can also draw a circle with: painter.drawArc(x, y, w, h, a, alen); Now I want to combine these two; my pixmap might not always be a circle…
Markus Meskanen
  • 19,939
  • 18
  • 80
  • 119
0
votes
1 answer

Qt5 QString and QPixmap

My image does not appear : QString champ("C:/champions/" + ui->comboBox->currentText() + "_1.jpg"); QPixmap image(champ); ui->label_1->setPixmap(QPixmap(image)); I tried to solve this for 2 hours. Help me please ! Sorry if my english is bad…
0
votes
2 answers

How to load a contact sheet of images with PySide?

The code below loads one image. I wish to load an unknown number of images which resides in a folder and I wish them to show up in a contact sheet kind of manner. How can I modify the code below so that it will take a list of images and show them…
fredrik
  • 9,631
  • 16
  • 72
  • 132
0
votes
1 answer

Qt QPixmap pointer limit

I have a very strange problem with QPixmap in Qt. I'm coding in C++ btw. Anyways the problem is, that as soon as I want to create a 9th QPixmap pointer in my main window class, the program crashes. so this works: class MainWindow : public…
rfreytag
  • 1,203
  • 11
  • 18
0
votes
1 answer

Passing image to QPixMap not as path in QT

Is there a way to pass an image as a name not as a path to Qpixmap in QT(C++),, for example i have the following code in which the processed image should be displayed using Qpixmap label but when i tried that i have to save it and then to pass it to…
Nermeeno Alami
  • 69
  • 1
  • 4
  • 9
0
votes
2 answers

While rotation of Images, Size of image decreases

hello all, I am trying to rotate the images in Qt. While rotating again and again, the size of the image decreases. how can i stop this size decrement ? please help me out. I am using this code. void MyWidget::rotateLabel() { …
Ashish
  • 219
  • 2
  • 6
  • 22
0
votes
1 answer

How to change coordinate system on Pixmap

Who knows how to move from top left coordinate system to the default, where X/Y-axis starts from the left bottom corner (like we always draw them) on QPixmap/Qimage
tema
  • 1,115
  • 14
  • 33
0
votes
4 answers

How to paint onto QLabel in another thread

I've got a specific target: to draw a road-net. So i have a number of dots (x,y) and I'd like to connect them (using drawLine function). Because of their amount (about 2-3 millions) I need to do in in another thread, so there a problem how should i…
tema
  • 1,115
  • 14
  • 33
0
votes
0 answers

Scrollbars disappear when try to overload paintEvent function

I have a QLabel in a QScrollArea. When I set the label's pixmap with the setPixmap function, the scrollbars appear to cover entire image. But when I try to overload the paintEvnet function and draw an image with QPainter::drawImage, scrollbars…
Hesam Qodsi
  • 1,569
  • 3
  • 25
  • 38
0
votes
1 answer

Qt PNG image not displaying

I just cannot get the png image to display, I check that it loads correctly which is does but nothing is displayed on my blank canvases. The third one is meant to display an image. Can someone please have a quick look? Thanks. QImage * QI = new…
Kachinsky
  • 573
  • 1
  • 7
  • 20
0
votes
1 answer

Grabwidget to grab the complete view even if it is zoomed in

I am using QPixmap QPixmap::grabWidget ( QWidget * widget, int x = 0, int y = 0, int width = -1, int height = -1 ) to grab the viewport in QPixmap object. In some case even if the screen is zoomed in to some level, i want to grab the complete…
user2147688
  • 95
  • 1
  • 9
0
votes
2 answers

Qt QPixmap constructing with qstring filename

I need to initialize a qpixmap object with its file directory It works if I do the following: image = new QPixmap("C:/Users/Administrator/Desktop/maze/HTetris-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug/untitled/c12.bmp"); and it works with as…
user1819047
  • 667
  • 9
  • 18