Thanks a lot,
Indeed using drawpoints method is extremely faster.
Wanted to try the other approach but didn't quite manage to do it, seems like I'm getting some random data.
To show the image I am doing:
ui->label->setPixmap(pixMap);
QImage tmp(Imagebits, 255, 255, QImage::Format_Mono);
QPixmap pixMap = QPixmap::fromImage(tmp);
ui->label->setPixmap(pixMap);
To copy to clipboard, switch view to plain text mode
to clear the image I am using:
tmp.fill(0);
Imagebits = tmp.bits();
QImage tmp(Imagebits, 255, 255, QImage::Format_Mono);
tmp.fill(0);
Imagebits = tmp.bits();
To copy to clipboard, switch view to plain text mode
without changing any bit in the array I am already getting random data.
By the way, thinking on how to access the array, method bits returns an uchar* does. It allocate a fixed size for all format or it is format dependent and in case mono pixels 0 - 7 are in first position etc?
Regarding the frame rate/erase redraw frequency it's true and a very good idea although I am acquiring data much faster and drawing real-time into pixmap (the 40 ms was more for context
). Even if I don't draw anything onscreen, just writing with drawpoint onto pixmap is very slow.
Bookmarks