Hi
I create the image from a memory buffer and set the colour table for the image, then load the mask file and add them to the QGraphicsScene , then update the viewport as shown below
//initialise buffer, width and height
.
.
image = new QImage(buffer,width, height,
QImage::Format_Indexed8);
image->setColorTable(cmap);
setMaximumSize(1024, 1024);
setMinimumSize(128, 128);
mask
= new QImage("mask_1.pgm",
"PGM");
//initialise buffer, width and height
.
.
image = new QImage(buffer,width, height, QImage::Format_Indexed8);
image->setColorTable(cmap);
setMaximumSize(1024, 1024);
setMinimumSize(128, 128);
mask = new QImage("mask_1.pgm","PGM");
To copy to clipboard, switch view to plain text mode
//update the scene every second using a timer
scene
->addPixmap
(QPixmap::fromImage(image
));
scene
->addPixmap
(QPixmap::fromImage(mask
));
viewport()->update(); //! force repaint
//update the scene every second using a timer
scene->addPixmap(QPixmap::fromImage(image));
scene->addPixmap(QPixmap::fromImage(mask));
viewport()->update(); //! force repaint
To copy to clipboard, switch view to plain text mode
Thanks for your help
Bookmarks