Image::GetPropertyIdList 메서드(gdiplusheaders.h)

Image::GetPropertyIdList 메서드는 이 Image 개체의 메타데이터에 사용되는 속성 식별자 목록을 가져옵니다.

구문

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

매개 변수

[in] numOfProperty

형식: UINT

목록 배열의 요소 수를 지정하는 정수입니다. Image::GetPropertyCount 메서드를 호출하여 이 숫자를 확인합니다.

[out] list

형식: PROPID*

속성 식별자를 수신하는 배열에 대한 포인터입니다.

반환 값

형식: 상태

메서드가 성공하면 Status 열거형의 요소인 Ok를 반환합니다.

메서드가 실패하면 Status 열거형의 다른 요소 중 하나를 반환합니다.

설명

Image::GetPropertyIdList 메서드는 PROPID의 배열을 반환합니다. Image::GetPropertyIdList를 호출하기 전에 해당 배열을 받을 수 있을 만큼 큰 버퍼를 할당해야 합니다. Image 개체의 Image::GetPropertyCount 메서드를 호출하여 필요한 버퍼의 크기를 확인할 수 있습니다. 버퍼의 크기는 Image::GetPropertyCount 의 반환 값에 sizeof( PROPID)를 곱한 값이어야 합니다.

예제

다음 예제에서는 JPEG 파일을 기반으로 Image 개체를 만듭니다. 코드는 해당 Image 개체의 Image::GetPropertyIdList 메서드를 호출하여 이미지에 저장된 메타데이터 유형을 확인합니다.

#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;
}

위의 코드는 특정 파일과 함께 FakePhoto.jpg 다음 출력을 생성했습니다.

320
10f
110
9003
829a
5090
5091

위의 출력에는 각 속성 식별자의 16진수 값이 표시됩니다. Gdiplusimaging.h에서 해당 숫자를 조회하고 다음 속성 태그를 나타내는 것을 확인할 수 있습니다.

16 진수 값 속성 태그
0x0320 PropertyTagImageTitle
0x010f PropertyTagEquipMake
0x0110 PropertyTagEquipModel
0x9003 PropertyTagExifDTOriginal
0x829a PropertyTagExifExposureTime
0x5090 PropertyTagLuminanceTable
0x5091 PropertyTagChrominanceTable
 

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows XP, Windows 2000 Professional [데스크톱 앱만 해당]
지원되는 최소 서버 Windows 2000 Server[데스크톱 앱만]
대상 플랫폼 Windows
헤더 gdiplusheaders.h(Gdiplus.h 포함)
라이브러리 Gdiplus.lib
DLL Gdiplus.dll

추가 정보

이미지

이미지::GetAllPropertyItems

이미지::GetPropertyCount

이미지::GetPropertyItem

이미지::GetPropertyItemSize

이미지::GetPropertySize

이미지::RemovePropertyItem

이미지::SetPropertyItem

PropertyItem

메타데이터 읽기 및 쓰기