private static AcAttachmentPoint Clasf_JustyText(JustifyText justify)
 {
     if (justify == JustifyText.Center)
     {
         return(AcAttachmentPoint.acAttachmentPointMiddleCenter);
     }
     else if (justify == JustifyText.Right)
     {
         return(AcAttachmentPoint.acAttachmentPointBottomRight);
     }
     else
     {
         return(AcAttachmentPoint.acAttachmentPointBottomLeft);
     }
 }
Ejemplo n.º 2
0
 public AnnotateImage(string customText, int textSize, Color textColour, Color bgColour,
                      bool showShutterSettings, bool showGainSettings, bool showLensSettings,
                      bool showCafSettings, bool showMotionSettings, bool showFrameNumber, bool allowCustomBackground,
                      bool showDateText, bool showTimeText, JustifyText justify, int xOffset, int yOffset)
 {
     CustomText                  = customText;
     TextSize                    = textSize;
     TextColour                  = textColour;
     BgColour                    = bgColour;
     ShowShutterSettings         = showShutterSettings;
     ShowGainSettings            = showGainSettings;
     ShowLensSettings            = showLensSettings;
     ShowCafSettings             = showCafSettings;
     ShowMotionSettings          = showMotionSettings;
     ShowFrameNumber             = showFrameNumber;
     AllowCustomBackgroundColour = allowCustomBackground;
     ShowDateText                = showDateText;
     ShowTimeText                = showTimeText;
     Justify = justify;
     XOffset = xOffset;
     YOffset = yOffset;
 }
 /// <summary>
 ///  Añadir un nuevo Poligono y un texto representado el largo de este.
 /// </summary>
 /// <param name="VerticesPolyline">Vertices del polígono. [System.Drawing]</param>
 /// <param name="LayerPolyline">Capa del Polígono</param>
 /// <param name="TextString">Texto adicional al largo del Polígono</param>
 /// <param name="PText_XYZ">Coordenadas del texto (X,Y,Z).</param>
 /// <param name="Width">Alto del Texto.</param>
 /// <param name="Height">Ancho del Texto.</param>
 /// <param name="LayerText">Capa del Texto.</param>
 /// <param name="StyleText">Estilo del Texto</param>
 /// <param name="Rotation">Ángulo de rotación del texto en grados </param>
 /// <param name="Width2">Ancho del cuadro de Texto.</param>
 /// <param name="JustifyText">Justificación del Texto.</param>
 public static void AddPolyline2DWithLengthText(PointF[] VerticesPolyline, string LayerPolyline, string TextString, double[] PText_XYZ, double Width, double Height, string LayerText, string StyleText, float Rotation, double Width2 = 1.3, JustifyText JustifyText = JustifyText.Left)
 {
     try {
         if (AcadDoc != null)
         {
             AcadLWPolyline polyline = AcadDoc.ModelSpace.AddLightWeightPolyline(ConvertirPuntosEnDoubles(VerticesPolyline));
             polyline.Layer = LayerPolyline;
             polyline.Update();
             TextString += @"%<\AcObjProp Object(%<\_ObjId " + polyline.ObjectID + @">%).Length \f " + (char)(34) + "%lu2%pr2" + (char)(34) + ">%";
             AddText(TextString, PText_XYZ, Width, Height, LayerText, StyleText, Rotation, Width2: Width2, JustifyText: JustifyText);
         }
     }
     catch
     {
         NotificadorErrores?.Invoke("Error inesperado.");
     }
 }
        /// <summary>
        /// Agrega un nuevo texto al documento actual.
        /// </summary>
        /// <param name="TextString">Texto a mostrar</param>
        /// <param name="P_XY">Coordenadas del texto (X,Y) [System.Drawing].</param>
        /// <param name="Width">Ancho del texto.</param>
        ///  <param name="Height">Alto del texto.</param>
        /// <param name="Layer">Capa del texto.</param>
        /// <param name="Style">Estilo del texto.</param>
        /// <param name="Rotation">Ángulo de rotación del texto en grados.</param>
        /// <param name="LineTypeSacale">Tipo de escala de la linea.</param>
        /// <param name="Width2">Ancho del cuadro de Texto.</param>
        /// <param name="JustifyText">Justificación del Texto.</param>

        public static void AddText(string TextString, PointF P_XY, double Width, double Height, string Layer, string Style, float Rotation, double LineTypeSacale = 1, double Width2 = 1.3, JustifyText JustifyText = JustifyText.Left)
        {
            if (AcadDoc != null)
            {
                try
                {
                    AcadMText text = AcadDoc.ModelSpace.AddMText(ConvertirPuntoEnDobules3D(P_XY), Width, TextString);
                    text.Layer           = Layer;
                    text.StyleName       = Style;
                    text.Height          = Height;
                    text.Rotation        = Rotation * Math.PI / 180;
                    text.LinetypeScale   = LineTypeSacale;
                    text.Width           = Width2;
                    text.AttachmentPoint = Clasf_JustyText(JustifyText);
                    text.Update();
                }
                catch
                {
                    NotificadorErrores?.Invoke("Error inesperado.");
                }
            }
        }
 public static UIComponent JustifyText(this UIComponent component, JustifyText justifyText)
 {
     component.DefaultAttributes.JustifyText = justifyText;
     return(component);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Agrega un nuevo texto al documento actual.
        /// </summary>
        /// <param name="TextString">Texto a mostrar</param>
        /// <param name="P_XYZ">Coordenadas del texto (X,Y,Z).</param>
        /// <param name="Width">Ancho del texto.</param>
        ///  <param name="Height">Alto del texto.</param>
        /// <param name="Layer">Capa del texto.</param>
        /// <param name="Style">Estilo del texto.</param>
        /// <param name="Rotation">Ángulo de rotación del texto en grados.</param>
        /// <param name="LineTypeSacale">Tipo de escala de la linea.</param>
        /// <param name="Width2">Ancho del cuadro de Texto.</param>
        /// <param name="justifyText">Justificación del Texto.</param>

        public static void AddText(string TextString, double[] P_XYZ, double Width, double Height, string Layer, string Style, float Rotation, double LineTypeSacale = 1, double Width2 = 1.3, JustifyText justifyText = JustifyText.Left)
        {
            if (AcadDoc != null)
            {
                AcadMText text = AcadDoc.ModelSpace.AddMText(P_XYZ, Width, TextString);
                text.Layer           = Layer;
                text.StyleName       = Style;
                text.Height          = Height;
                text.Rotation        = Rotation * Math.PI / 180;
                text.LinetypeScale   = LineTypeSacale;
                text.Width           = Width2;
                text.AttachmentPoint = Clasf_JustyText(justifyText);
                text.Update();
            }
        }