QByteArray buf=NULL; originalPixmap =QPixmap(); originalPixmap = QPixmap::grabWindow(QApplication::desktop()->winId()); QString strfname; strfname.sprintf("%d",c); originalPixmap.save("C:\\Program Files\\image"+strfname+".jpeg","jpeg"); c++; char Data; QFile file("C:\\Program Files\\image"+strfname+".jpeg"); file.open(QIODevice::ReadOnly); int len=file.size(); //buf=file.read(len); buf=file.readAll(); file.close(); file.remove(); QSqlQuery query; query.exec("INSERT INTO log (grab_date, ip_address, image,logged_user) " "VALUES (?,?,?,?)"); query.bindValue(0,dd); query.bindValue(1,address); query.bindValue(2,buf.toBase64()); query.bindValue (3,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)