+ QImage img(global_flags.width, global_flags.height, QImage::Format_ARGB32_Premultiplied);
+ size_t pitch = global_flags.width * 4;
+ for (int y = 0; y < global_flags.height; ++y) {
+ memcpy(img.scanLine(global_flags.height - y - 1), buf + y * pitch, pitch);
+ }
+
+ QPixmap pixmap;
+ pixmap.convertFromImage(QImage(img));
+ ui->grabbed_frame_label->setPixmap(pixmap);
+