Extracting color from the layer file (.lyr file).

1936
0
08-06-2012 11:38 PM
SandipPoddar
New Contributor
Hi,

My requirement is to read the symbology color from the .lyr file and use those RGB color code to draw graphics on FLEX UI. but while getting the RGB color through IColor interface I am not geting correct values. for example if I set RED color symbology (255,0,0) for the .lyr file then i am getting value 255 i.e. blue from IColor.RGB. if I set Blue color symbology (0,0,255) for the .lyr file then i am getting 16711680 from IColor.RGB i.e. red color.

Please suggest where i am doing wrong.

I have attached two sample layer files along with the mdb data for testing purpose.

IUniqueValueRenderer pUniqueRend = pFRend as IUniqueValueRenderer;
ISymbol psym = pUniqueRend.get_Symbol(pUniqueRend.get_Label(pUniqueRend.get_Value(i).ToString()));

if (psym is MultiLayerFillSymbol)
{
IMultiLayerFillSymbol pFill = psym as IMultiLayerFillSymbol; {
IColor pColor = pFill.Color;
int rgb = pColor.RGB;
}

Thanks a lot in advance for your support.

Regards,
Sandip
0 Kudos
0 Replies