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 39 40 41 42
|
// #include <utilcls.h> // <---------ne pas oublier
void __fastcall TForm1::Button11Click(TObject *Sender)
{
// lister les proprietes d'une image
Variant vMSWIAImageFile;
String S;
// Création conteneur pour l'image à manipuler
vMSWIAImageFile = Variant::CreateObject("WIA.ImageFile");
// Chargement de l'image dans le conteneur
vMSWIAImageFile.OleFunction("LoadFile", "C:\\Documents and Settings\\blondelle\\Mes documents\\Mes images\\monImageMultipage.tif");
// Boucle sur la collection de propriétés
for(int nb = 1; nb <= vMSWIAImageFile.OlePropertyGet("Properties").OlePropertyGet("Count"); nb++)
{
S = vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("Name");
S = S + " (";
S = S + vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("PropertyID");
S = S + ") =";
if(vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("IsVector"))
{
S = S + " - vector data not emitted - ";
}
// RationalImagePropertyType = 1006
else if(vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("Type") == 1006)
{
S = S + (vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("Value").OlePropertyGet("Numerator"));
S = S + "/";
S = S + (vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("Value").OlePropertyGet("Denominator"));
}
else if(vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("Type") == 1002)
{
S =S + """" + (vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("Value")) + """";
}
else
S = S + (vMSWIAImageFile.OlePropertyGet("Properties", nb).OlePropertyGet("Value"));
Memo1->Lines->Add(S);
}
} |
Partager