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

how add object cimg in Qwidget

I am creating an application in qt and use cimg to handle the graphics. My question is how I put an item CImg within a QWidget?
jackajack
  • 153
  • 1
  • 1
  • 11
0
votes
1 answer

convert a uint16 dicom image to qimage

i tried to convert a dicom image read from a gdcm image reader which has photometric interpretation as 'monochrome2' and pixel format as unsigned int 16 or uint16, i tried the following code over it, but is not giving the required image, please…
0
votes
1 answer

Qt: QGraphicObject and QImage

I have a QGraphicsObject derived class that holds a QImage and ovveride paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) In the pain I succefully draw the QImage. The QGraphicsObject is an item of QGraphicsScene,…
Blackbelt
  • 156,034
  • 29
  • 297
  • 305
0
votes
1 answer

Qt can't load any image in Release config

I was trying to build a project using QDir and QImage. I noticed that in Debug configuration everything works fine - QDir loads all the files in an app dir and writes whole paths to output. I can load an image to a QImage object, convert it and…
makciook
  • 1,537
  • 10
  • 19
0
votes
1 answer

QGraphicsPixmapItem

QGraphicsPixmapItem, like QGraphicsItem, has a method update(x0, y0, width, height), in order to redraw a pixmap only partly on a QGraphicsScene. Calling this will schedule a paint() (in Qt's event loop) on the QGraphicsItem, and after this paint()…
Herbert
  • 5,279
  • 5
  • 44
  • 69
0
votes
2 answers

Qt Cannot convert QPaintDevice to QImage

This sounds like silly, but I cannot take a screenshot of a QwebView. QImage image(view.page()->viewportSize(), QImage::Format_ARGB32); QPainter painter; painter.begin(image); // Here is the error. See…
Dewsworld
  • 13,367
  • 23
  • 68
  • 104
0
votes
2 answers

Error with sequence argument when using QtConcurrent map

I'm trying to use QtConcurrent::map to run this function //This function is used through QtConcurrent::map to create images from a QString path void MainWindow::createQImage(QString* path) { //create an image from the given path QImage* t =…
jdjalm
  • 9
  • 1
-1
votes
1 answer

PyQt5 Place QImage in a widget

I created a small GUI that allows me to draw a number. That number is supposed to be classified with a CNN. The CNN is not connected to this GUI yet. Will do that later on. I am still very new to PyQt5 and used some code that i found online for the…
Marvin
  • 17
  • 1
  • 6
-1
votes
1 answer

QT live camera on QImage. Application crashes due to out of memory. Memory increases with speed

I am using QT Qpixmap to show the image captured from the camera using the OpenCV frame. I am doing following steps Capture image using OpenCV Convert the OpenCV image to QImage Convert QImage to Qpixmap Show it on Qlabel The problem I am facing is…
Imran
  • 775
  • 7
  • 19
-1
votes
1 answer

Send QImage from c++ client to python server

The c++ client has QImage which must be sent via a tcp socket to the python server and saved in jpeg there. The server does not use qt. Could you explain how to do this correctly? How do I write data from QImage to the socket and how do I read it in…
RemQ
  • 1
-1
votes
1 answer

Rotate QImage in QListWidget

Got a small app where in a QListWidget many QImage and text are displayed with this function: void TileDisplay::DisplayTiles() { for(int i = 0; i < m_tiles.size(); i++) { QListWidgetItem *item = new QListWidgetItem("Tile " +…
Paxsentry
  • 193
  • 2
  • 14
-1
votes
1 answer

Qt - Transform cv::Mat to QImage in worker thread crashes

Introduction What i want is really simple: I want to start the process of reading a binary file via a button in a main ui thread, let a seperate thread handle the processing including transformation into QImage and return this image back to the main…
goulashsoup
  • 2,639
  • 2
  • 34
  • 60
-1
votes
1 answer

QImage: auto detect format when loading image

I have an image with .jpg extension but it is stored as png format. When I use QImage to load that image, it returns an invalid QImage: QImage image (path); if (image.isNull()) { //it enters here } I have to check format one by one before…
pat
  • 497
  • 3
  • 12
-1
votes
1 answer

I want to view the original Image

I want to view the original Image file. But all Images are converted into the spotted,corrupted image. It seems that the previous image is not equal to the behind image. Please change the image size in the QImage's constructor into your arbitrary…
Haru
  • 1,884
  • 2
  • 12
  • 30
-1
votes
2 answers

How to visualize QImage in QML

I have a QAbstractListModel with custom objects as items. Each object has a QImage that is loaded from a database. I use ListView in QML to visualize it but I do not see any mean to represent QImage in the delegate. Image primitive seems to accept…
user14416
  • 2,922
  • 5
  • 40
  • 67
1 2 3
36
37