Layer color to System.Drawing.Color

1
vjedlicka
9/14/2020 9:50 AM

I am trying to convert color of a layer to System.Drawing.Color.

The ColorType is "ByColorIndex". How do I find out the actual color?

Wout
9/14/2020 9:59 AM

You can call Color.ToArgbColor(DxfIndexedColorSet), and convert thta to System.Drawing.Color. The output will depend on the color set you choose, you can for instance use DxfIndexedColorSet.AcadClassicIndexedColors as parameter. Or you can use GraphicsConfig.IndexedColors if you have already a specific GraphicsConfig you want to use.

- Wout

vjedlicka
9/14/2020 11:35 AM

Works fine,
Thank you
Vaclav

1