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

How to get the gamma value of QImage

In QImageWriter there is an option for setting the gamma value if the image but i want to know how to get the present gamma value so i can represent it in my histogram of the image .
Wagmare
  • 1,354
  • 1
  • 24
  • 58
0
votes
1 answer

OpenCV 2.4.7 conflict with Qt 4.8.1 QImage

Ubuntu 12.04, Qt 4.8, OpenCv 2.4.3, PCL 1.6. Developing all via Qt Creator 2.5.2. All in 64 bits version. I din't faced this issue until now, due to the fact I was dealing with image files in disk via "cv::imread(filename)" and then transferring its…
Bull
  • 748
  • 1
  • 11
  • 24
0
votes
0 answers

Issue saving QGraphicsScene to a PNG file

I have a QGraphicScene object that I can save to a PNG file just fine as long as I haven't made any modifications like a scroll or a zoom on the item. After performing a scroll or a zoom, the saved image becomes small with a lot of transparent…
roundtheworld
  • 2,651
  • 4
  • 32
  • 51
0
votes
1 answer

QGLWidget - faster grabFrameBuffer

I have a kind of streaming application, which should capture the content of a window. In the window a QGLWidget draws the stuff. At the moment I am using widget.grabFrameBuffer in every draw cycle (has to be real time). The app uses 100% CPU and…
user1347198
0
votes
1 answer

QImage::scaleHeight transformation mode returning NULL image

I'm trying to resize the image size to 120X240. image = image.scaledToHeight(120); image = image.scaledToWidth(240); For some images which have dimension 837x630 ,getting error as, QImage::scaleHeight: Image is a null image QImage::scaleWidth:…
user3167959
  • 31
  • 1
  • 6
0
votes
0 answers

QImage is null while reading image from resources

I am developing a simple fps shooter for a college project. I am using C++, Qt and OpenGL and I'm having a problem during texture loading. I put my textures into resource file. After loading, QImage object which stores a texture, is null. Here is my…
0
votes
1 answer

QImage transform returns null

I have an image, and I'm trying to transform selected part of the image using QImage::transformed(const QTransform &matrix, Qt::TransformationMode mode) const method. But this method return null image. Also Qt wrote to std output: "Qimage: out of…
yaroslav
  • 115
  • 1
  • 11
0
votes
1 answer

QGraphicsView shows artifacts after opening file dialog

I'm not terribly familiar with Qt's memory model especially when it comes to image handling. I'm created a blank pixmap and adding it to a QGraphicsView's scene. This seems to work correctly jumping between two sizes, but I've noticed I get…
voodoogiant
  • 2,118
  • 6
  • 29
  • 49
0
votes
0 answers

Set up a QGridLayout with equal cell size with QWidgets + QPainter.DrawImage not displaying the image

First I will describe what I want to do. I am using QT to build a window application. What I essentially wanted to do is say, I want a gridlayout which will be 10x10 and all the cells will be 5x5 but without having to populate the grid first! I…
czioutas
  • 1,032
  • 2
  • 11
  • 37
0
votes
1 answer

raw to jpeg image conversion- qt

i have raw image buffer. i am converting it into jpeg using following code: height = 240; width = 320; raw_image=capture(width, height);//(c code uvc capture) QImage tmpImage = QImage(raw_image, width, height, QImage::Format_RGB32 );…
geek
  • 794
  • 3
  • 16
  • 41
0
votes
1 answer

Is QImage format Format_ARGB32 data signed or unsigned int?

I want to convert a QImage of format RGB888 to ARGB32 & fetch pixel data as unsigned int*. I can do the following to convert to ARGB32 QImage new = old.convertToFormat(QImage::Format_ARGB32); However, are the pixels stored signed or…
P.C.
  • 651
  • 13
  • 30
0
votes
1 answer

Convert cv::mat to QImage using QImage::loadFromData

I’ve found similar topics but not this particular one. Any ideas what’s wrong with the following code? It returns ‘loaded=false’, which obviously means that image data cannot be loaded. cv::Mat mymat; QImage qimg; mymat =…
ichos
  • 1
  • 2
0
votes
1 answer

How to convert multi page Magick++ Image to QImage?

I convert Magick++ single page Image to QT image (QPixmap, actually, but could be QImage as well) with: Blob my_blob_1; Image img1; img1.magick("MNG"); // or PNG img1.write(&my_blob_1); const QByteArray…
0
votes
1 answer

Alternative for QIMAGE function in QTSDK 4.8.4

Is there an alternative for using QImage myImage(w, h, QImage::Format_ARGB32); in Qt? (w and h are width and height of imported picture)? This is the code: if (tif) { uint32 w, h; TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w); …
0
votes
1 answer

Populate a QListWidget with QImage

I have a QListWidget instance in the middle of my application. I want to populate it with some dynamically created QImage. After reading the manual I have understand that i have to pass through a QIcon object. But.. How can I create a QIcon from a…
nkint
  • 11,513
  • 31
  • 103
  • 174