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

Image::GetFrameDimensionsCount 메서드는 이 Image 개체의 프레임 차원 수를 가져옵니다.

구문

UINT GetFrameDimensionsCount();

반환 값

형식: UINT

이 메서드는 이 Image 개체의 프레임 차원 수를 반환합니다.

설명

이 메서드는 여러 페이지와 여러 해상도의 두 가지 스타일로 제공되는 다중 프레임 이미지에 대한 정보를 반환합니다.

여러 페이지 이미지는 둘 이상의 이미지를 포함하는 이미지입니다. 각 페이지에는 단일 이미지(또는 프레임)가 포함되어 있습니다. 이러한 페이지(또는 이미지 또는 프레임)는 일반적으로 애니메이션 GIF 파일과 같은 애니메이션 시퀀스를 생성하기 위해 연속적으로 표시됩니다.

다중 해상도 이미지는 서로 다른 해상도의 이미지 복사본을 두 개 이상 포함하는 이미지입니다.

Windows GDI+는 임의의 수의 페이지(또는 이미지 또는 프레임)와 임의의 해상도 수를 지원할 수 있습니다.

예제

다음 콘솔 애플리케이션은 TIFF 파일을 기반으로 Image 개체를 만듭니다. 이 코드는 Image::GetFrameDimensionsCount 메서드를 호출하여 Image 개체에 포함된 프레임 차원 수를 확인합니다. 이러한 각 프레임 차원은 GUID로 식별되며 Image::GetFrameDimensionsList 호출은 해당 GUID를 검색합니다. 첫 번째 GUID는 pDimensionIDs 배열의 인덱스 0에 있습니다. Image::GetFrameCount 메서드에 대한 호출은 첫 번째 GUID로 식별되는 차원의 프레임 수를 결정합니다.

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

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

   Image* image = new Image(L"Multiframe.tif");

   // How many frame dimensions does the Image object have?
   UINT count = 0;
   count = image->GetFrameDimensionsCount();
   printf("The number of dimensions is %d.\n", count);
   GUID* pDimensionIDs = (GUID*)malloc(sizeof(GUID)*count);

   // Get the list of frame dimensions from the Image object.
   image->GetFrameDimensionsList(pDimensionIDs, count);

   // Display the GUID of the first (and only) frame dimension.
   WCHAR strGuid[39];
   StringFromGUID2(pDimensionIDs[0], strGuid, 39);
   wprintf(L"The first (and only) dimension ID is %s.\n", strGuid);

   // Get the number of frames in the first dimension.
   UINT frameCount = image->GetFrameCount(&pDimensionIDs[0]);
   printf("The number of frames in that dimension is %d.\n", frameCount);
    
   free(pDimensionIDs);
   delete(image);
   GdiplusShutdown(gdiplusToken);
   return 0;
}

위의 코드는 특정 파일인 Multiframe.tif와 함께 다음 출력을 생성했습니다.

The number of dimensions is 1.
The first (and only) dimension ID is {7462DC86-6180-4C7E-8E3F-EE7333A7A483}.
The number of frames in that dimension is 4.

Gdiplusimaging.h에서 표시된 GUID를 조회하고 페이지 차원의 식별자임을 확인할 수 있습니다. 따라서 프로그램 출력은 Multiframe.tif 파일에 4개의 페이지가 있음을 알려줍니다. 즉, 페이지 차원의 4개의 프레임입니다.

요구 사항

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

참고 항목

Multiple-Frame 이미지에서 개별 프레임 복사

다중 프레임 이미지 만들기 및 저장

EncoderParameter

이미지

이미지::GetFrameCount

이미지::GetFrameDimensionsList

이미지::SaveAdd 메서드