我的一个测试程序用来读取sqlite库文件表中的bmp图片数据,图片数据是用BLOB格式存储的.
sqlite3_prepare(db,"SELECT * FROM examineeinfo;", -1,&stat,0);
sqlite3_step(stat);
int size = sqlite3_column_bytes(stat,6);
const void * test = sqlite3_column_blob(stat,1);
const QByteArray picture(size);
for(i=0;i<=size;i++)
{
picture
= *((const QByteArray *) test +i);
}
QPixmap image1(picturearray) ;
PixmapLabel1->setPixmap( image1 );
PixmapLabel1->setScaledContents( TRUE );
sqlite3_close(db);
我想通过以下语句显示图片.
QPixmap image1(azResult[13]) ;
PixmapLabel1->setPixmap( image1 );
PixmapLabel1->setScaledContents( TRUE );
结果运行时报错:
QPixmap::convertToImage: Cannot convert a null pixmap
QImage::smoothScale: Image is a null image
请问:通过什么方式才能正确的显示数据库文件中的图片.我处理方式错在哪里.
谢谢.[ 此贴被XChinux在2006-10-09 13:07重新编辑 ]