[Qt-interest] QImage::copy fails : Too many color components: 0, max 10
James Yan
jyan972 at gmail.com
Tue Jul 21 18:40:22 CEST 2009
hey,
i fail to copy sub-area of an image with QImage, console give me the hint
: QImage::copy fails : Too many color components: 0, max 10
source code like this one:
QImage im;
if(im.load("d:/1013570.jpg"))
{
QImage formated = im.convertToFormat(QImage::Format_RGB888);
QImage cp = formated.copy(104,192,258-104,327-192);
cp.save("d:/cp.jpg");
}
while this one will be OK:
QImage im;
if(im.load("d:/1013570.jpg"))
{
QImage cp = im.copy(104,192,258-104,327-192);
cp.save("d:/cp.jpg");
}
why? and how to correct it? thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090722/71bc5f9a/attachment.html
More information about the Qt-interest-old
mailing list