originalPixmap =QPixmap(); originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId()); QString strfname; strfname.sprintf("%d",c); originalPixmap.save("D:\\image"+strfname+".jpeg","jpeg"); c++; char Data; QFile file("D:\\image"+strfname+".jpeg"); file.open(QIODevice::ReadOnly); file.seek(0); int len=file.size(); QByteArray buf; buf=file.read(len); QSqlQuery query; query.prepare("INSERT INTO log (id,grab_date, ip_address, image,logged_user) " "VALUES (:id, :grab_date, :ip_address, :image, :logged_user)"); query.bindValue(":id",400); query.bindValue(":grab_date",(QVariant)'2011-04-26 15:55:09'); query.bindValue(":ip_address",(QVariant)'172.16.0.51'); query.bindValue(":image",(QVariant)buf.data()); query.bindValue ( ":logged_user",(QVariant) hostname); bool qry=query.exec();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)