Results 1 to 11 of 11

Thread: renderPixmap

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    95
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy renderPixmap

    Two days ago this code capture perfectly the opengl screen, but now capture a black rectangle:

    Qt Code:
    1. void Visor::BTNcaptura_click()
    2. {
    3. QSize size = getSize();
    4. if (size.isValid()) {
    5. //QPixmap pixmap = QPixmap::grabWidget(glWidget, 0,0, size.width(), size.height()); <-- this capture a green rectangle
    6. QPixmap pixmap = glWidget->renderPixmap(size.width(), size.height()); <-- this capture a black rectangle
    7. QString fileName = QFileDialog::getSaveFileName(this,tr("Guardar la imagen como..."),QString(),
    8. tr("Archivos de imágenes (*.png *.jpg *.bmp *.jpeg *.ppm *.xbm *.xpm);;Todos los Archivos (*)"));
    9. if (!fileName.isEmpty()){
    10. QString filter=QFileInfo(fileName).suffix();
    11. if (filter=="jpg")
    12. pixmap.save(fileName,"jpg");
    13. ...
    14. else
    15. pixmap.save(fileName+".png","png");
    16. }
    17. }
    18. }
    To copy to clipboard, switch view to plain text mode 


    What happend?
    Last edited by jacek; 1st March 2007 at 21:02. Reason: wrapped too long line

Similar Threads

  1. renderPixmap and texture
    By techno in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2006, 12:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.