before I bind the pixmap to texture, I scale it to 800 and 600 pixels. Now, I also want to rotate the image by 90 degrees. I do not know how to do that. another way is to bind the texture simply and for the rotation part I rotate it inside the paintGL. As I remember this is done via transformation matrix, but I don't know how to modify it so that the pixmap is 90 rotated.
void GlWidget
::pixmapCatchFromForm(QPixmap pixmap
) {
deleteTexture(texture);
// image->loadFromData(bytes, "PNG");
pixmap.
scaled(QSize(800,
600));
texture = bindTexture(pixmap);
qDebug() << "texture:" << texture; // returns 1
updateGL();
}
void GlWidget::pixmapCatchFromForm(QPixmap pixmap)
{
deleteTexture(texture);
// image->loadFromData(bytes, "PNG");
pixmap.scaled(QSize(800,600));
texture = bindTexture(pixmap);
qDebug() << "texture:" << texture; // returns 1
updateGL();
}
To copy to clipboard, switch view to plain text mode
Bookmarks