Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: Drawing a AnnTextObject so that it will dynamically resize its bounds
Started by leftback at 06-19-2008 10:17. Topic has 6 replies.

Print Search « Previous Thread Next Thread »
  06-19-2008, 10:17
leftback is not online. Last active: 4/10/2008 9:02:37 AM leftback

Top 50 Posts
Joined on 03-14-2008
Posts 35
Drawing a AnnTextObject so that it will dynamically resize its bounds
Reply Quote
How can I create an AnnTextObject without knowing how wide or how many lines the string object has before initialisation?

At the moemnts I'm just setting the width in the bounds to be 100 and it obviously doesnt always show all of the text!

Thanks!
   Report 
  06-20-2008, 16:04
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,815
Re: Drawing a AnnTextObject so that it will dynamically resize its bounds
Reply Quote
Which LEADTOOLS version and interface (API, COM, etc.) are you using?

I'm afraid I don't completely understand your goal.  Are you trying to create a text object that is exactly the size of the string?  Please explain in more detail.

Greg Ross
LEADTOOLS Technical Support
   Report 
  07-14-2008, 10:10
Jake Ewald is not online. Last active: 12/1/2008 6:14:24 PM Jake Ewald

Top 500 Posts
Joined on 11-30-2007
Posts 11
Re: Drawing a AnnTextObject so that it will dynamically resize its bounds
Reply Quote
Sorry to piggyback on this thread, but I'm curious about this topic as well.

Is there a way to measure the width of the text within an annotation?  Depending on the font size it may wrap the text to a new line and I need to be aware of that wrapping as I would want to then increase the annotation height or decrease the font size so that all of the text is visible within the annotation. Visually I can see that it doesn't fit, but is it possible to detect in code that some of the text is being cut off?

In my instance I'm using version 15 of the .Net assemblies.

   Report 
  07-14-2008, 11:21
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,815
Re: Drawing a AnnTextObject so that it will dynamically resize its bounds
Reply Quote
LEADTOOLS doesn't have anything to measure strings.  In order to accomplish this, you need to use the System.Drawing.Graphics.DrawString method. 

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.measurestring.aspx

To get the Graphics object, use the RasterImage.CreateGdiPlusGraphics method.

Greg Ross
LEADTOOLS Technical Support
   Report 
  07-14-2008, 11:50
Jake Ewald is not online. Last active: 12/1/2008 6:14:24 PM Jake Ewald

Top 500 Posts
Joined on 11-30-2007
Posts 11
Re: Drawing a AnnTextObject so that it will dynamically resize its bounds
Reply Quote
My next question would then be, is there a way to determine the margins that the annotation is using?  I created a thread about the EdgeMargin property ( http://support.leadtools.com/SupportPortal/cs/forums/21172/ShowPost.aspx ) but there's been no updates to address the issue.  If I use the bounds of the annotation as my reference on the text being cut off, I then also need to account for whatever margins the annotation is using, if any.  The EdgeMargin would have to be exact, but from what I've seen it's off by a small amount (the EdgeMargin is set to 0, but there's still a gap between the text and the annotation's edge).  I assume the logic that Leadtools is using internally accounts for this margin when displaying/wrapping text, but I'm not sure how to get at that.

Thanks for your quick response, it's much appreciated.

   Report 
  07-15-2008, 9:40
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,815
Re: Drawing a AnnTextObject so that it will dynamically resize its bounds
Reply Quote
Unfortunately, there is not any way to do this currently.  Qasem submitted an incident for you, and our engineers will investigate it and fix it or add the functionality if it's a problem or an approved change (this might be more of a feature request than a bug).

I've requested that if this isn't a bug, that the engineers provide a way to calculate the small permanent margin.

Greg Ross
LEADTOOLS Technical Support
   Report 
  07-15-2008, 9:53
Jake Ewald is not online. Last active: 12/1/2008 6:14:24 PM Jake Ewald

Top 500 Posts
Joined on 11-30-2007
Posts 11
Re: Drawing a AnnTextObject so that it will dynamically resize its bounds
Reply Quote
Ok, thanks for your help

   Report 
Post
LEAD Support Fo... » Developer » Annotations » Re: Drawing a AnnTextObject so that it will dynamically resize its bounds

Powered by Community Server, by Telligent Systems