Questions tagged [qimage]

A QImage is a class from the Qt toolkit which provides a hardware-independent image representation that allows direct access to the pixel data, and can be used as a paint device.

Qt provides four classes for handling image data: QImage, QPixmap, QBitmap and QPicture. QImage is designed and optimized for I/O, and for direct pixel access and manipulation.

Because QImage is a QPaintDevice subclass, QPainter can be used to draw directly onto images. When using QPainter on a QImage, the painting can be performed in another thread than the current GUI thread.

The QImage class supports several image formats, including monochrome, 8-bit, 32-bit and alpha-blended images.

QImage provides a collection of functions that can be used to obtain a variety of information about the image. There are also several functions that enable transformation of the image.

QImage objects can be passed around by value since the QImage class uses implicit data sharing. QImage objects can also be streamed and compared.

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

549 questions
0
votes
1 answer

Corrupted QImage from raw pixel data

Basing my work off of this answer, I'm attempting to use Qt's QGLWidget to render video, but I'm having some issues. When saving a frame right after I've decoded it in my video decoding thread, it comes out just fine: but when drawing it, it comes…
Matt Kline
  • 10,149
  • 7
  • 50
  • 87
0
votes
0 answers

Qt - QImage works on one computer and not on another

This piece of code works correctly on my development computer, but not on a test one: QImage img("Y:/SharedImages/img.jpg"); cout << "TEST image size: " << img.size().width() << " x " << img.size().height() << " Null? " << img.isNull() <<…
Pietro
  • 12,086
  • 26
  • 100
  • 193
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
1 answer

QImage to QPixmap through another thread

I've a problem with sending QImage to GUI-thread: this is my code in child-thread: QSize size = ui->label_2->size(); size=ui->label_2->size(); QImage…
tema
  • 1,115
  • 14
  • 33
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

Convert HBITMAP to QImage without using QPixmap

I am extracting thumbnails of files from Windows in a secondary thread and the output is an HBITMAP. Now I got to convert this to QImage to send it back to the main thread. As you might already know, using QPixmap in non-gui threads results in…
Prad Lal
  • 113
  • 7
0
votes
1 answer

Double char array mapping to QImage

Im having a double pointer char of dataBuffer[1000][1000] in that char pointer some places i will make hex value 0xFF and remaining 0x00 (for openGL plotting) now i want it to show it as a QWidget with the hex value in pixel. i found QImage we can…
Wagmare
  • 1,354
  • 1
  • 24
  • 58
0
votes
1 answer

Cant fill QImage via setPixel properly

I need to convert QImage to an array where each pixel is represented by three integers(channels). So I'm trying to achieve this with fillowing code: void Processor::init(QImage *image){ QColor* c = new QColor(); int i,j; int local_ind; x =…
Roman
  • 1,396
  • 4
  • 15
  • 39
0
votes
1 answer

QImage OpenCV - setPixel with only green and black colors

I made a simple graphical user interface with Qt and I use OpenCV for making processing on webcam streaming, i.e canny edge detection. I try to implement a switch between two displays of the webcam : 1*) "normal Mode" : a grayscale display where…
user1773603
0
votes
1 answer

sending qimage over qtcpsocket: received only part of the data

i am creating an application where i need to send some images over tcp. the sending part is QImage image; image.load("image.png", "PNG"); image.setText("name", "color"); QByteArray ba; QBuffer buffer(&ba); image.save(&buffer, "PNG"); int…
stavrop
  • 465
  • 2
  • 8
  • 20
0
votes
2 answers

cv::Mat to QImage strange behavior

I'm using the code suggested in ( how to convert an opencv cv::Mat to qimage ) to display a cv::Mat in my Qt application. However, I'm getting strange results. The black parts are displayed as black, but all other values are inverted. Conversion…
Ryan Kennedy
  • 3,275
  • 4
  • 30
  • 47
0
votes
2 answers

QImage Rotation without losing infomation

I have a QImage of size 12x12 in GIF format. I want to rotate it on certain angle with very high frequency. My application involves a robot so when it changes its orientation(which it does very frequently) my QImage in simulation should also be…
0
votes
1 answer

Image raw data Ros and Qt

I have a simulation in Gazebo in which I am publishing an image raw data topic which have raw image data. Now I want to display that data in qt as a video. I am not sure what I should use as a video widget. What I have in mind is to make a…
0
votes
1 answer

32 bit png images on device with 16 bit display

Does anyone know how to convert 32 bit images to show on device with 16 bit display ? I tried to create a 24 bit image with Qt QImage - QImage QImage::convertToFormat and save the result image, but the image I got was also 32 bit (I see the this…
user1335880
  • 81
  • 2
  • 8
0
votes
3 answers

Fastest method to convert IplImage IPL_DEPTH_32S to QImage Format_RGB32

What is the fastest method to convert IplImage IPL_DEPTH_32S to QImage Format_RGB32? I need to catch pictures from cam and show it on form with frequency 30 frames in second. I tried to use QImage constructor: QImage qImage((uchar *)…
Robotex
  • 1,064
  • 6
  • 17
  • 41