I'm currently working on a Project with Images. I've tested one Image in CMYK-Format, and one in RGB. Both are Bitmaps. Bitmaps have the Property "PixelFormat". It's an Enum, where the Values are:
0 Undefined
0 DontCare (Yes, it's C# Basic btw, not any third library..)
15 Max
Indexed 65536
... The other values are way above those numbers.
If i read the PixelFormat of the RGB-Bitmap, it returns "PixelFormat.Format24bppRgb". That's like it's supposed to be.
If i read the PixelFormat of the CMYK-Bitmap, it returns the value 8207.
8207 is not implemented in the Enum, but it gets returned anyways. I found a workaround to forget about this fact, but it still lets me wonder about that.
Following Code is WORKING:
public static Test testProperty
{
get { return (Test) 691337; }
}
public enum Test
{
FirstValue=0,
SecondValue = 24
}
So like the title says:
Why can i cast an enum into a value, that is not defined in the enum-Body?