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