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
-1
votes
1 answer

Convert command line argument to Qimage

This is not a Most Vexing Parse problem, because doing the following will also result in linker errors although there's no ambiguity: QImage baseline("C:\img1.png"); QImage test_image("C:\img1.png"); My application gets 2 command line arguments…
Gela
  • 1
  • 7
-1
votes
1 answer

White gaussian noise addition using Qt

I looked out in the internet as well as I looked in here (stackoverflow) and could not find a good answer on how to implement white gaussian noise addition into my qimage object. or if there is an existing function which I can use? any…
Daniel Eitan
  • 45
  • 1
  • 7
-1
votes
1 answer

QML Camera - take a Square photo

How can I take a photo using Camera in QML but with custom dimensions, like a square photo for example? I am trying to implement it with QQuickImageProvider but I am not understanding why it is not working. QML code Camera { id: camera …
GuiDupas
  • 1,681
  • 2
  • 22
  • 44
-1
votes
1 answer

QImage::load jpg not plotting to view / scene?

Image is not being plotted to the screen? QGraphicsScene *scene = new QGraphicsScene(); scene->setSceneRect(0, 0, 996, 996); scene->setItemIndexMethod(QGraphicsScene::NoIndex); QGraphicsView *view = new…
jdl
  • 6,151
  • 19
  • 83
  • 132
-1
votes
1 answer

Qt - Verify if Image loaded is grayscale

I have developed a small GUI in C++/Qt, I would like to know a fast way to test if image loaded is grayscale. In practise, when I load a grayscale image of gif format, I want it to be recognized as a grayscale image with depth()=8, and when I load a…
user1773603
-2
votes
1 answer

Simple form with pixel manipulation in Qt

I'm completely newbie to Qt i want to create a 800X600 window that just show some circle and be able to manipulate pixels of the form. there is no interaction between user and form(no click, no dblclick,...) it just shows some circles with one color…
Mason
  • 165
  • 1
  • 1
  • 10
-2
votes
1 answer

C++/Qt5: Get a random image file from specified location

Given a folder and subfolders all containing jpeg files, what function can I write an function to pull a random file from it, every time the function is called. For example say we have the follwing directory structure: root_directory/ ├──…
glamis
  • 85
  • 9
-2
votes
2 answers

scale a QImage in Qt

What the easiest way to draw an image as a background for a QGraphicsRectItem? I can set the background as follows but I can't scale the image: QGraphicsRectItem *enemyItem; QImage *image = new QImage(":/PaperMario.png"); QBrush *brush = new…
Thomas
  • 1,678
  • 4
  • 24
  • 47
-3
votes
2 answers

how to convert a Jpeg Base64 string to a jpeg image in Qt

I am beginning with Qt I need to convert a Base64 string of a Jpeg image into a Qimage and display it in a QLabel Can someone please direct me as to how to go about doing this?
SAHLA
  • 83
  • 1
  • 7
1 2 3
36
37