qpixmap

What is the best way to get the hash of a QPixmap?

I am developing a graphics application using Qt 4.5 and am putting images in the QPixmapCache, I wanted to optimise this so that if a user inserts an image which is already in the cache it will use that. Right now each image has a unique id which helps optimises itself on paint events. However I realise that if I could calculate a hash...

"Python.exe" crashes when PyQt's setPixmap() is called with a Pixmap

I have a program that sends and receives images to each other using sockets. The server sends the image data using 'image.tostring()' and the client side receives it and turns it back into an image using 'Image.fromstring', then into a QImage using 'ImageQt.ImageQt(image)', turns it into a QPixmap using 'QPixmap.fromimage(qimage)'then up...

Saving QPixmap to JPEG failing (Qt 4.5)

Hello. I have the following code. QString fileName = QFileDialog::getSaveFileName( this, tr("Output Image file"), (""), tr("PNG (*.png);;JPEG (*.JPEG);;Windows Bitmap (*.bmp);;All Files (*.*)") ); if(fileName != "") { QwtPlot* pPlot = ... QSize size = pPlot->size(); QRect printingRect(QPoint(0, 0), size); QPi...

[PyQt4] Load blob image data into QPixmap

Hi, I am writing a program using PyQt4 for front-end GUI and this program accesses a back-end database (which can be either MySQL or SQLite). I need to store some image data in the database and below is the Python code I use to import image files (in JPEG format) to a blob data field in the database: def dump_image(imgfile): i = o...

How to solve QPixmap::fromImage memory leak?

Hello everyone! I have a problem with Qt. Here is a part of code that troubles me: void FullScreenImage::QImageIplImageCvt(IplImage *input) { help=cvCreateImage(cvGetSize(input), input->depth, input->nChannels); cvCvtColor(input, help, CV_BGR2RGB); QImage tmp((uchar *)help->imageData, help->width, help->height, help->w...

QPainter fails when calling begin

Hi, I'm trying to paint a PNG file on a QsplashScreen. Im' trying to do it via QPaitner. The reason I want to do it via QPainter is because I want it to minimize smoothly (until it disappear), When I'm just repaiting it it doesn't looks smooth at all. I passed the QSplashScreen to the QPainter constructor. When I call begin() in the QPa...

reading and writing QByteArrays

I'm having trouble reading and writing QByteArray data to a file. My goal is to save QPixmap data into a QByteArray and save that QByteArray to a file (with the ability to read this QByteArray back from the file and into a QPixmap). I want to use following code from the QPixmap documentation: QPixmap pixmap(<image path>); ...

QGraphicsView scrolling and image scaling/cropping

I would like to have a background image in my QGraphicsView that is always scaled (and cropped if necessary) to the size of the viewport, without scrollbars and without scrolling with the keyboard and mouse. The example below is what I am doing to scale and crop an image in the viewport, but I am using random values for the cropping that...

jamvm1.5+classpath-0.96+qt4.3 QPixmap: It is not safe to use pixmaps outside the GUI thread

jamvm -Dawt.toolkit=gnu.java.awt.peer.qt test QPixmap: It is not safe to use pixmaps outside the GUI thread I'm new to Qt, I don't know how to deal with it. ...

QT- QImage and multi-threading problem.

Greetings all, Please refer to image at : http://i48.tinypic.com/316qb78.jpg We are developing an application to extract cell edges from MRC images from electron microscope. MRC file format stores volumetric pixel data (http://en.wikipedia.org/wiki/Voxel) and we simply use 3D char array(char***) to load and store data (gray scale valu...

Qt QPixmap::grabWidget on ActiveX widget

I have a Qt app which embeds a Flash Player ActiveX control. I put a button over the flashplayer and I need to set some parts of it transparent. Since the AX control is not part of the Qt rendering pipe, it's needed to fake the transparency. For this purpose I grab the contents of the AX control from under the button, and use it when ren...

Converting an image to text

Hey everyone, I want to be able to save an image as text in a xml file and I can't manage to find a efficient way to do it ! So far I tried : QByteArray ImageAsByteArray; QBuffer ImageBuffer(&ImageAsByteArray); ImageBuffer.open(QIODevice::WriteOnly); rImage.save(&ImageBuffer, "PNG"); return QString(ImageAsByteArray.toBase64()); D...