Results 1 to 8 of 8

Thread: save Qimage in a file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    phoenix, AZ
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default save Qimage in a file

    hi,
    l'm downloading a file ( image.png) from an instrument using GPIB...l get the file as ASCII, save it in a file. But then when l try to load in Qimage, l get a error message from Libpng lirary. but l can open the saved image on the disk with Infrview and other picture viewer.


    Qt Code:
    1. QFile file("out.png");
    2. if (!file.open(QIODevice::WriteOnly))
    3. return 0;
    4. QTextStream out(&file);
    5. out << image;
    6. file.close();
    7. myImage->load("out.png");
    To copy to clipboard, switch view to plain text mode 

    should l convert the Qstring image to an other format before to save in the file ?

    regards,

    Michael
    Last edited by wysota; 18th March 2011 at 23:37. Reason: missing [code] tags

Similar Threads

  1. QImage->save(); returns 0
    By ramzes13 in forum Newbie
    Replies: 2
    Last Post: 22nd September 2010, 15:49
  2. Qimage::save returns false in release
    By CCTeam in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2010, 18:35
  3. Can't save QImage
    By hvengel in forum Qt Programming
    Replies: 6
    Last Post: 14th June 2008, 22:07
  4. QImage : trouble with save() method
    By krivenok in forum Qt Programming
    Replies: 12
    Last Post: 3rd May 2006, 21:55
  5. Replies: 3
    Last Post: 15th March 2006, 12:44

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.