LEADTOOLS Support
Document
Document SDK Questions
Re: Using .Net font dialog to get the Annfont properties for create a new AnnFont Object
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, September 10, 2009 5:55:24 AM(UTC)
Groups: Registered
Posts: 6
I got a problem that when i pass the "fontString" to create AnnFont Object. Is it LT must need to use AnnLenght to set the fontsize value?
FontDialog fd = new FontDialog();
if(fd.ShowDialog() != DialogResult.Cancel )
{
Font font = fd.Font;
TypeConverter tc = TypeDescriptor.GetConverter(typeof(Font));
string fontString = tc.ConvertToString(font);
Font newFont = (Font)tc.ConvertFromString(fontString);
}
#2
Posted
:
Friday, September 11, 2009 6:15:36 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
You shouldn't have to do any conversions like you are attempting. Just use the properties of the System.Drawing.Font object to create the Leadtools.Annotations.AnnFont object.
Check out MSDN for documentation on the different properties of the System.Drawing.Font class:
http://msdn.microsoft.co...rawing.font_members.aspxFor the most part, the only properties you'll need are the Family, Style, and the size. For example:
System.Drawing.Font font
// get Font from dialog
Leadtools.Annotation.AnnFont annFont = new AnnFont(font.FontFamily, new AnnLength(font.SizeInPoints, AnnUnit.Point), font.Style)
LEADTOOLS Support
Document
Document SDK Questions
Re: Using .Net font dialog to get the Annfont properties for create a new AnnFont Object
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.