ImageProperties 클래스

정의

항목의 이미지 관련 속성(예: 파일 또는 폴더)에 대한 액세스를 제공합니다.

public ref class ImageProperties sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class ImageProperties final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class ImageProperties
Public NotInheritable Class ImageProperties
상속
Object Platform::Object IInspectable ImageProperties
특성
구현

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

이 예제에서는 DateTaken 및 Rating과 같은 이미지 속성을 포함하여 파일의 속성을 검색하는 방법을 보여 줍니다.

try
{
    StorageFile file = rootPage.sampleFile;
    if (file != null)
    {
        StringBuilder outputText = new StringBuilder();

        // Get image properties
        ImageProperties imageProperties = await file.Properties.GetImagePropertiesAsync();
        outputText.AppendLine("Date taken: " + imageProperties.DateTaken);
        outputText.AppendLine("Rating: " + imageProperties.Rating);
    }
}
// Handle errors with catch blocks
catch (FileNotFoundException)
{
 // For example, handle a file not found error
}

GetImagePropertiesAsyncimageProperties 완료되면 ImageProperties 개체를 가져옵니다.

예제 file 에서 에는 속성을 검색할 파일을 나타내는 StorageFile 이 포함되어 있습니다.

설명

항목의 Properties 속성(예: 폴더 파일)에서 getImagePropertiesAsync 메서드를 사용하여 ImageProperties 개체에 비동기적으로 액세스하거나 사용 가능한 경우 ImageProperties 속성을 동기적으로 사용할 수 있습니다. 다음 메서드 및 속성을 사용하여 ImageProperties 개체를 가져올 수 있습니다.

참고

다른 앱(예: Microsoft Word)에서 정의한 속성 처리기를 사용하여 설정하거나 가져오는 속성에 액세스할 수 없습니다. 대신 시스템 인덱스에서 백업하는 파일 쿼리를 사용하여 이러한 속성을 가져올 수 있습니다. 자세한 내용은 QueryOptions를 참조하세요.

속성에 액세스하는 방법에 대한 자세한 코드 샘플은 파일 액세스 샘플을 참조하세요.

속성

CameraManufacturer

사진을 찍은 카메라 제조업체를 가져오거나 설정합니다.

CameraModel

사진을 찍은 카메라의 모델을 가져오거나 설정합니다.

DateTaken

이미지를 찍은 날짜를 가져오거나 설정합니다.

Height

이미지의 높이를 가져옵니다.

Keywords

이미지와 연결된 키워드의 컬렉션을 가져옵니다.

Latitude

사진을 찍은 위도 좌표를 가져옵니다.

Longitude

사진을 찍은 경도 좌표를 가져옵니다.

Orientation

사진의 EXIF(Exchangeable Image File) 방향 플래그를 가져옵니다.

PeopleNames

사진에 태그가 지정된 사람의 이름을 가져옵니다.

Rating

이미지 파일과 연결된 등급을 가져오거나 설정합니다.

Title

이미지의 제목을 가져오거나 설정합니다.

Width

이미지의 너비를 가져옵니다.

메서드

RetrievePropertiesAsync(IIterable<String>)

항목과 연결된 지정된 속성을 검색합니다.

SavePropertiesAsync()

항목과 연결된 모든 속성을 저장합니다.

SavePropertiesAsync(IIterable<KeyValuePair<String,Object>>)

항목과 연결된 지정된 속성 및 값을 저장합니다.

적용 대상

추가 정보