Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def set_pixmap(self, msg, w_img, h_img):
- print msg
- print [msg]
- self._zoom = 0
- self.img_width = w_img
- self.img_height = h_img
- self.qImg = QImage(msg, w_img, h_img, w_img, QImage.Format_Grayscale8)
- self._photo = QGraphicsPixmapItem(QPixmap(self.qImg))
- self._photo.mousePressEvent = self.pixelSelect
- self._scene.addItem(self._photo)
- void ImageViewer::setPixmapImage(QByteArray image_data, int image_width, int image_height
- {
- zoom = 0;
- qDebug() << image_data;
- }
- unsigned char data[image_resolution];
- qDebug() << data;
- memcpy(data, image_data.toStdString().c_str(), image_resolution);
- qDebug() << data;
- qImg = QImage(data, image_width, image_height, image_width, QImage::Format_Grayscale8);
- qDebug() << qImg.byteCount();
- unsigned char data[image_resolution];
- memcpy(data, image_data.toStdString().c_str(), image_resolution);
- qImg = QImage(data, image_width, image_height, image_width, QImage::Format_Grayscale8);
- QPixmap pixmap = QPixmap::fromImage(qImg);
- QGraphicsPixmapItem * Pix = scene->addPixmap(pixmap);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement