bool QPixmap::loadFromData ( const uchar * data, uint len, const char * format = 0, Qt::ImageConversionFlags flags = Qt::AutoColor )
Loads a pixmap from the len first bytes of the given binary data. Returns true if the pixmap was loaded successfully; otherwise returns false.
The loader attempts to read the pixmap using the specified format. If the format is not specified (which is the default), the loader probes the file for a header to guess the file format.
If the data needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to control the conversion.
See also load() and Reading and Writing Image Files.
Partager