Get property id in Windows Forms
I have images in Resources and I would like to get their ID. I haven't found the following code from MSDN to be very helpful.
How did he get the numbers 20624 and 20625?
If I have an image with Properties.Resources.Image1
, how can I programmatically get its 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);
}
+2
a source to share
1 answer
MSDN provides a hexadecimal list of propertyitem and associated tags.
In your example 20624 (0x5090) is PropertyTagLuminanceTable
20625 (0x5091)PropertyTagChrominanceTable
Edit: Just note, these IDs don't have access to the images themselves, but rather the metadata about the image.
0
a source to share