2010-05-06 2 views
2

리소스에 이미지가 있습니다. ID를 얻고 싶습니다. MSDN에서 다음 코드를 찾아 보면 도움이 될 것입니다.Windows Forms에서 속성 ID 가져 오기

숫자 20624와 20625는 어떻게 획득 되었습니까?

Properties.Resources.Image1으로 액세스 할 수있는 이미지가 있다면 프로그래밍 방식으로 해당 ID를 가져올 수 있습니까?

private void DemonstratePropertyItem(PaintEventArgs e) 
{ 

    // Create two images. 
    Image image1 = Image.FromFile("c:\\FakePhoto1.jpg"); 
    Image image2 = Image.FromFile("c:\\FakePhoto2.jpg"); 

    // Get a PropertyItem from image1. 
    PropertyItem propItem = image1.GetPropertyItem(20624); 

    // Change the ID of the PropertyItem. 
    propItem.Id = 20625; 

    // Set the PropertyItem for image2. 
    image2.SetPropertyItem(propItem); 

    // Draw the image. 
    e.Graphics.DrawImage(image2, 20.0F, 20.0F); 
} 

답변

0

MSDN은 list of propertyitem ids in hexdecimal format 및 해당 태그를 제공합니다. 당신의 예에서

, 20624 (0x5090)이 PropertyTagLuminanceTable 및 20625 (0x5091)이다 PropertyTagChrominanceTable

편집이다 : 그냥 메모, 그 ID는 이미지에 대해 오히려 메타 데이터를 이미지 자체에 액세스하지만 것은 아니다.

+0

속성 ID가 무엇인지에 대해 완전히 오해했습니다. id는 이미지를 식별하고 int propId를 사용하여 이미지를 검색 할 수 있다고 생각했습니다. 감사합니다. – zaidwaqi