Ejemplo n.º 1
0
        public static ulong AddTextByLayer(vdDocument activeDocument, string textContent, gPoint insertPoint, VdConstVerJust verJust, VdConstHorJust horJust, string fontFile, double textHeight, double widthFactor, VectorDraw.Render.grTextStyleExtra.TextLineFlags textLineFlags, double textRotation, bool ifBold)
        {
            //We will create a vdText object and add it to the Active Layout which is the basic Model Layout always existing in a Document.
            VectorDraw.Professional.vdFigures.vdText onetext = new VectorDraw.Professional.vdFigures.vdText();
            //We set the document where the text is going to be added.This is important for the vdText in order to obtain initial properties with setDocumentDefaults.
            onetext.SetUnRegisterDocument(activeDocument);
            onetext.setDocumentDefaults();


            onetext.TextString = textContent;

            //vdText object with setDocumentDefaults has the STANDARD TextStyle.We will change the font of this textstyle to Verdana.
            //   activeDocument.TextStyles.Standard.FontFile = fontFile;
            //We set the insertion point depending the width of the Text from the vdFigure's BoundingBox

            onetext.InsertionPoint = insertPoint;
            onetext.VerJustify     = verJust;
            onetext.HorJustify     = horJust;
            onetext.TextLine       = textLineFlags;
            onetext.Height         = textHeight;
            onetext.WidthFactor    = widthFactor;
            onetext.Rotation       = textRotation;
            onetext.Bold           = ifBold;
            //Now we will add this object to the Entities collection of the Model Layout(ActiveLayout).
            activeDocument.ActiveLayOut.Entities.AddItem(onetext);
            return(onetext.Handle.Value);
        }
Ejemplo n.º 2
0
        public static ulong AddText(vdDocument activeDocument, string textContent, gPoint insertPoint, VdConstVerJust verJust, VdConstHorJust horJust, int TextColor, string fontFile, double textHeight, double widthFactor, VectorDraw.Render.grTextStyleExtra.TextLineFlags textLineFlags, double textRotation, bool ifBold)
        {
            //We will create a vdText object and add it to the Active Layout which is the basic Model Layout always existing in a Document.
            VectorDraw.Professional.vdFigures.vdText onetext = new VectorDraw.Professional.vdFigures.vdText();
            //We set the document where the text is going to be added.This is important for the vdText in order to obtain initial properties with setDocumentDefaults.
            onetext.SetUnRegisterDocument(activeDocument);
            onetext.setDocumentDefaults();

            //The two previus steps are important if a vdFigure object is going to be added to a document.
            //Now we will change some properties of the text.
            onetext.PenColor.SystemColor = Color.FromArgb(TextColor);
            onetext.TextString           = textContent;


            onetext.InsertionPoint = insertPoint;
            onetext.VerJustify     = verJust;
            onetext.HorJustify     = horJust;
            onetext.TextLine       = textLineFlags;
            onetext.Height         = textHeight;
            onetext.WidthFactor    = widthFactor;
            onetext.Rotation       = textRotation;
            onetext.Bold           = ifBold;
            onetext.Style.FontFile = fontFile;

            //Now we will add this object to the Entities collection of the Model Layout(ActiveLayout).
            activeDocument.ActiveLayOut.Entities.AddItem(onetext);
            return(onetext.Handle.Value);
        }
Ejemplo n.º 3
0
        public static ulong AddText(vdDocument activeDocument, string textContent, gPoint insertPoint, int textColor, VdConstVerJust verJust, VdConstHorJust horJust, string txtStyle)
        {
            //We will create a vdText object and add it to the Active Layout which is the basic Model Layout always existing in a Document.
            VectorDraw.Professional.vdFigures.vdText onetext = new VectorDraw.Professional.vdFigures.vdText();
            //We set the document where the text is going to be added.This is important for the vdText in order to obtain initial properties with setDocumentDefaults.
            onetext.SetUnRegisterDocument(activeDocument);
            onetext.setDocumentDefaults();

            //The two previus steps are important if a vdFigure object is going to be added to a document.
            //Now we will change some properties of the text.
            onetext.PenColor.SystemColor = Color.FromArgb(textColor);
            onetext.TextString           = textContent;


            onetext.InsertionPoint = insertPoint;
            onetext.VerJustify     = verJust;
            onetext.HorJustify     = horJust;

            onetext.Style = GetTextStyleByName(activeDocument, txtStyle);

            //Now we will add this object to the Entities collection of the Model Layout(ActiveLayout).
            activeDocument.ActiveLayOut.Entities.AddItem(onetext);
            return(onetext.Handle.Value);
        }