Text with styles
Moderators: SDS, support, admin
Text with styles
Hi
Could you give me some examples on how to create several texts with different styles (bold, underlined, different fonts...)
I am using CADImport.NET and VB
Thanks and happy new year
Could you give me some examples on how to create several texts with different styles (bold, underlined, different fonts...)
I am using CADImport.NET and VB
Thanks and happy new year
Hello!
Please try the following code:
Texs parameters must be changed through the CADStyle.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
Please try the following code:
Code: Select all
<font color="blue">Private Sub</font id="blue"> AddText_Click(<font color="blue">ByVal</font id="blue"> sender <font color="blue">As</font id="blue"> System.Object, <font color="blue">ByVal</font id="blue"> e <font color="blue">As</font id="blue"> System.EventArgs) <font color="blue">Handles</font id="blue"> AddText.Click
<font color="blue">If</font id="blue"> (<font color="blue">Me</font id="blue">.cadImage <font color="blue">Is Nothing</font id="blue">) <font color="blue">Then
Me</font id="blue">.cadImage = <font color="blue">New</font id="blue"> CADImage
<font color="blue">Me</font id="blue">.cadImage.InitialNewImage()
<font color="blue">Me</font id="blue">.cadImage.UseDoubleBuffering() = <font color="blue">False
End If
Me</font id="blue">.cadImage.Converter.PointDisplayMode = 0
<font color="blue">Me</font id="blue">.cadImage.UseDoubleBuffering = <font color="blue">False</font id="blue">
Dim text As CADText = <font color="blue">New</font id="blue"> CADText
Dim st1 As CADStyle = <font color="blue">New</font id="blue"> CADStyle
st1.FontName = "txt"
text.SetStyle(st1)
text.Color = Color.Red
text.Point = <font color="blue">New</font id="blue"> DPoint(0, 0, 0)
text.Height = 10
text.Rotation = 0
text.Text = "Hello World!!"
text.LineWeight = 0.1
text.Loaded(<font color="blue">Me</font id="blue">.cadImage.Converter)
<font color="blue">Me</font id="blue">.cadImage.CurrentLayout.Entities.Add(text)
<font color="blue">Me</font id="blue">.cadImage.Converter.OnCreate(text)
<font color="blue">Me</font id="blue">.cadPictBox.Invalidate()
<font color="blue">End Sub</font id="blue">
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Could you explain to me the effects of this line?
Me.cadImage.Converter.PointDisplayMode = 0<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Property CADConverter.PointDisplayMode - gets or sets a value indicating a mode of displaying the CADPoint entities in the loaded CAD image.
Returns 0 if CADPoints are visible; returns 1 if CADPoints are invisible.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Besides Ñ—Which fontnames can I use?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
What ever you need.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com
Me.cadImage.Converter.PointDisplayMode = 0<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Property CADConverter.PointDisplayMode - gets or sets a value indicating a mode of displaying the CADPoint entities in the loaded CAD image.
Returns 0 if CADPoints are visible; returns 1 if CADPoints are invisible.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Besides Ñ—Which fontnames can I use?<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
What ever you need.
Sergey.
Please post questions to the forum or write to support@cadsofttools.com