ThinkGeo.com    |     Documentation    |     Premium Support

CreateCompoundPointStyle : How To Symbol Center Alignment

Hi I’m using CreateCompoundPointStyle to generate a compound symbole Star inside a circle.

valueStyle.ValueItems.Add(new ValueItem(“M1”, PointStyles.CreateCompoundPointStyle(PointSymbolType.Circle, GeoColors.White, GeoColors.Red, 1, 24, PointSymbolType.Star, GeoColors.Red, GeoColors.Black, 1, 18)));

Star is placed off-center . How to specify offsets for star shape?

Hi Avinash,

It looks for the CreateCompoundPointStyle function we cannot set its offset, maybe you can choose to use an image instead of build the shape by code:
PointStyle pointStyle = new PointStyle(new GeoImage());

Regards,

Ethan

Ethan,
I need 100+ on a layer. I feel using Image may have performance impact hence I’m trying to use built in vector styles.
Thanks

Hi Avinash,

I just want to update this post. I get reply from our developer, we can set the offset for the scenario like yours (Circle outer, Start inner).

Please view the test code:

PointStyle pointStyle = PointStyles.CreateCompoundPointStyle(PointSymbolType.Circle, GeoColors.White, GeoColors.Red, 1, 24, PointSymbolType.Star, GeoColors.Red, GeoColors.Black, 1, 18);
pointStyle.XOffsetInPixel = -1;
pointStyle.YOffsetInPixel = -2;
valueStyle.ValueItems.Add(new ValueItem(“1”, pointStyle));

And it looks like:

Wish that’s helpful.

Regards,

Ethan

Thanks Ethan,
I’d try it

Hi Avinash,

Any question please let us know.

Regards,

Ethan