PDA

View Full Version : Faster way to manage an image



vinnzcrafts
20th May 2014, 01:03
Good day people
I'm here to ask for your help on the following:
How can I manage an image in a faster way in Qt, or even plain C++ if this is possible at all.
Instead of creating a QGraphicsView with a QGraphicsScene and QGraphicsPixmapItem
and update it etc... I need a way where I could alter a pixel array and update it directly as if I was poking
inside the QGraphicsView drawing area directly... If Qt is not the tool to do that feel free to indicate
some framework or something in which I can do this.
I'm looking for this because I'm making a program with heavy graphics but not the kind of thing
that QPainter draws neither I need different graphics items, I just need to be able to use this giant
pixmap like an array and update the changes fast to the screen.
Thanks in advance

wysota
26th May 2014, 12:13
QImage can work on a pixel-by-pixel basis. However after doing any pixel manipulation operation you have to convert it to QPixmap and then you can display it in any way offered by Qt -- either using graphics view, a ready widget such as QLabel or your own custom widget where you do your own custom painting (which is probably most suitable to what you need however it requires the most work).

vinnzcrafts
28th May 2014, 22:17
Good one, I will study this through, I will probably go with with the Qt event despite being more work.... :)
Thanks again