Hello, I am creating a custom style and I am overriding the DrawCore of Style (For other reasons I am using Style and Not TextStyle). I am able to draw my text on the screen but it is always centered on the point. I want the text to be left aligned and not centered. How can I do this with the canvas.DrawText( ) ?
I would appreciate any thoughts you have on this.
I have:
GeoFont font =
new
GeoFont(fontFamily, fontSize, fontStyle);
GeoSolidBrush brush =
new
GeoSolidBrush(customColor);
GeoPen geoPen =
new
GeoPen(GeoColor.SimpleColors.Black);
RectangleShape worldExtent = canvas.CurrentWorldExtent;
ScreenPointF screenPoint = ExtentHelper.ToScreenCoordinate(worldExtent, CurrentFeature, canvas.Width,
canvas.Height);
ScreenPointF[] screenPoints =
new
[] {
new
ScreenPointF(screenPoint.X, screenPoint.Y) };
canvas.DrawText(text, font, brush, geoPen, screenPoints, DrawingLevel.LabelLevel,
0, 0, (
float
)rotation);
The code above centers the text but I want it left aligned.