GetTextSize method

439
1
Jump to solution
09-03-2013 04:25 AM
PrzemyslawTyrtania
New Contributor
following code will get me xSize and ySize, but as i zoom in and out i can see that text size stays constant, but size should be longer if i zoom out, if i understand right Size is in ppi(point per inch) so i'd need to know how many points in an inch depending on zoom level so that i can get correct text length, any idea how to get this?

double xSize = 0.0; double ySize = 0.0; display.StartDrawing(display.hDC, (short)esriScreenCache.esriNoScreenCache); ((ITextSymbol)textSymbol).GetTextSize(display.hDC, display.DisplayTransformation, text, out xSize, out ySize); display.FinishDrawing();
0 Kudos
1 Solution

Accepted Solutions
AlexanderGray
Occasional Contributor III
1 point is 1/72 of an inch.  The relationship between the points and the ground size is the scale of the map.  You can get the mapscale from the Imap interface.

for example:
10pt text on 1/10,000 map is
10 * 1/72  / 1/10,000 = 1,388.9 inches or 35.3 meters

View solution in original post

0 Kudos
1 Reply
AlexanderGray
Occasional Contributor III
1 point is 1/72 of an inch.  The relationship between the points and the ground size is the scale of the map.  You can get the mapscale from the Imap interface.

for example:
10pt text on 1/10,000 map is
10 * 1/72  / 1/10,000 = 1,388.9 inches or 35.3 meters
0 Kudos