ThinkGeo.com    |     Documentation    |     Premium Support

Scaled Text

I need to display scaled true type font text on the map window.  This would be text that changes with the map scale.  I will also need to rotate this text on occasion.  Is this possible?  Can you give me any insight on how to bigen?



Charles,


There are couples of similar projects which probably can give you some help even thought they are not doing exactly what you are trying to do, if you are interested, take a look and have try:

code.thinkgeo.com/projects/s...imagestyle

code.thinkgeo.com/projects/s...imagestyle

code.thinkgeo.com/projects/s...basedoncol

code.thinkgeo.com/projects/show/northarrow


Any more questions or discussion are welcome.


Thanks.


Yale

 



Thanks for the reply.  I am using a Custom Style to place scaled standard text.  This is text that I am stroking from a coordinate list.  This works quite well and is reasonably fast.  I am guessing that I will have to create an image of the true type text that is scaled and then place the image at the proper rotation angle.  I know that I can create a picture box of the appropriate size, and draw the text to the picture box.  At this point I’m not sure what will work.  I think I can use PictureBox.Image.Save(imageStream, imageFormat).  The stream imageStream can then be used to create a GeoImage, which is then drawn using canvas.DrawWorldImage.  I guess my biggest concern is that this is a lot of conversions to go through for each text element. 
  
 Does this sound like it will work?  Can you suggest any shortcuts?

Charles, 
  
 I am always thinking you are using Desktop Map Control to show the labels, so why are you trying to put it into a PictureBox?  
  
 And the way you create the image put to picture box also seems reluctant. Basically, what we need to do is hook up the customer text style with one layer and it will draw the labels to the Map Control automatically, why you want to create an image first and put the label on it? 
  
 Sorry for my bad understanding. 
  
 Let me know if any more questions. 
  
 Thanks. 
  
 Yale 


Yale, 
  
 I could draw the text directly, but the only control I have using any of the canvas.DrawText… methods is the font size of the GeoFont I select.  Although I can change the font size with the scale of the canvas, the scale of the canvas is infinitely variable and the font size is incrementally variable.  If I want the text to be 40 feet tall no matter the canvas scale, I don’t think font size will do the trick.  Does this make sense?  Is there another method I can use? 
  
 Charles

Charles, 
  
 I think a better way is to set a different text style which can set different font size or color etc that would make your job much easier. 
  
 Any more questions let me know. 
  
 Thanks. 
  
 Yale 


Charles,



 I let you know that there is a new project posted in our Code Community that shows how to label at world size in meters, feet etc.





code.thinkgeo.com/projects/show/worldsizedtextstyle