1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| QFile file(FileName);
if(!file.open(QIODevice::ReadOnly)) //On ouvre le fichier en lecture seule
{
QMessageBox::information(this, tr("Image Viewer"),
tr("Cannot Open %1.").arg(FileName));
}
else
{
QMessageBox::information(this, tr("Image Viewer"),
tr("File succesfull Open %1.").arg(FileName));
file.seek(0) ;
QDataStream in(&file);//Lecture des données contenues dans le fichier.
quint16 FileMagic ;
quint16 NbLignes ;
quint16 NbColonnes ;
quint16 GrayLevel ;
quint16 LengthComments ;
in >> FileMagic >> NbLignes >> NbColonnes >> GrayLevel >> LengthComments;
QMessageBox::information(this, tr("Image Viewer"),
tr("the number of the File Magic is%1.").arg(FileMagic),tr("the number of the rows is%1.").arg(NbLignes ),tr("the number of the columns is%1.").arg(NbColonnes ) );
QMessageBox::information(this, tr("Image Viewer"),
tr("the number of the GrayLevel is%1.").arg(GrayLevel));
QMessageBox::information(this, tr("Image Viewer"),
, tr("the length of the comment is%1.").arg(LengthComments) ) ;
ça m'affiche n'importe quoi et je sais pas c'est en quoi les valeurs qu'il m'affiche est ce en Octet??? |
Partager