Método Image::GetPropertyIdList (gdiplusheaders.h)

El método Image::GetPropertyIdList obtiene una lista de los identificadores de propiedad usados en los metadatos de este objeto Image .

Sintaxis

Status GetPropertyIdList(
  [in]  UINT   numOfProperty,
  [out] PROPID *list
);

Parámetros

[in] numOfProperty

Tipo: UINT

Entero que especifica el número de elementos de la matriz de lista . Llame al método Image::GetPropertyCount para determinar este número.

[out] list

Tipo: PROPID*

Puntero a una matriz que recibe los identificadores de propiedad.

Valor devuelto

Tipo: Estado

Si el método se ejecuta correctamente, devuelve Ok, que es un elemento de la enumeración Status .

Si se produce un error en el método, devuelve uno de los otros elementos de la enumeración Status .

Comentarios

El método Image::GetPropertyIdList devuelve una matriz de PROPIDs. Antes de llamar a Image::GetPropertyIdList, debe asignar un búfer lo suficientemente grande como para recibir esa matriz. Puede llamar al método Image::GetPropertyCount de un objeto Image para determinar el tamaño del búfer necesario. El tamaño del búfer debe ser el valor devuelto de Image::GetPropertyCount multiplicado por sizeof( PROPID).

Ejemplos

En el ejemplo siguiente se crea un objeto Image basado en un archivo JPEG. El código llama al método Image::GetPropertyIdList de ese objeto Image para averiguar qué tipos de metadatos se almacenan en la imagen.

#include <windows.h>
#include <gdiplus.h>
#include <stdio.h>
using namespace Gdiplus;

INT main()
{
   GdiplusStartupInput gdiplusStartupInput;
   ULONG_PTR gdiplusToken;
   GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

   UINT count = 0; 
   Image* image = new Image(L"FakePhoto.jpg");

   // How many types of metadata are in the image?
   count = image->GetPropertyCount();
   if(count == 0)
      return 0;

   // Allocate a buffer to receive an array of PROPIDs.
   PROPID* propIDs = new PROPID[count];

   image->GetPropertyIdList(count, propIDs);

   // List the retrieved IDs.
   for(UINT j = 0; j < count; ++j)
      printf("%x\n", propIDs[j]);

   delete [] propIDs;
   delete image;   
  
   GdiplusShutdown(gdiplusToken);
   return 0;
}

El código anterior, junto con un archivo determinado, FakePhoto.jpg, generó la siguiente salida:

320
10f
110
9003
829a
5090
5091

La salida anterior muestra el valor hexadecimal de cada identificador de propiedad. Puede buscar esos números en Gdiplusimaging.h y averiguar que representan las siguientes etiquetas de propiedad.

Valor hexadecimal Etiqueta de propiedad
0x0320 PropertyTagImageTitle
0x010f PropertyTagEquipMake
0x0110 PropertyTagEquipModel
0x9003 PropertyTagExifDTOriginal
0x829a PropertyTagExifExposureTime
0x5090 PropertyTagLuminanceTable
0x5091 PropertyTagChrominanceTable
 

Requisitos

Requisito Value
Cliente mínimo compatible Windows XP, Windows 2000 Professional [solo aplicaciones de escritorio]
Servidor mínimo compatible Windows 2000 Server [solo aplicaciones de escritorio]
Plataforma de destino Windows
Encabezado gdiplusheaders.h (include Gdiplus.h)
Library Gdiplus.lib
Archivo DLL Gdiplus.dll

Consulte también

Imagen

Image::GetAllPropertyItems

Image::GetPropertyCount

Image::GetPropertyItem

Image::GetPropertyItemSize

Image::GetPropertySize

Image::RemovePropertyItem

Image::SetPropertyItem

PropertyItem

Lectura y escritura de metadatos