Is there any example Qt code which displays the image from an unsigned char display buffer? Each byte on the buffer corresponds to the Gray scale pixel color. The content of the display buffer changes at run time in specified intervals. I need to change the display buffer content as fast as I can, so that the image seems to be moving. My question is how to draw pixels from the buffer very fast? I don’t need to save the image, just want to display it. Please help
Share
QImageprovides a constructor for initialization using anunsigned charbuffer. In order to display it you could use aQGraphicsViewwith aQGraphicsScene. Every time the data of the buffer changes you could call a slot similar to the following one:You could also use the
QPixmap‘sloadFromDatain order to load directly the pixmap from the unsigned char array and avoid theQImagestep.