Hi,
I am trying to use DrawTextWithWorldCoordinate.GdiPlusGeoCanvas to create a preview of how text will appear when the user labels features on a layer. What I want to do is return an image that can be set as the Image property of a label. Obviously I want the text to be nicely displayd. The problem is that the text always seems to draw at some point to the left of where I would like it to be. Here is the line of code I am using:
oCanvas.DrawTextWithWorldCoordinate("Sample Text",
oFont,
oBrush,
0,
oSize.Height - 20,
DrawingLevel.LabelLevel)
Where oSize.Height is the height of the label I am using to display the image. From the screenshot you can see that the text does not display properly.
I have anticipated your request for a sample project and have attached it. I am using the full version of MSD, 5.0.0.0. Please tell me what I am doing wrong.
Thanks!
Steve
DrawTextWithGeoCanvas.zip (49.1 KB)