Home Image-Pro Automation (Macros, Apps, Reports)
Options

annotation properties

I can create an annotation as follows:

        With [Select].Annotations.ShapeCommands.Text(Nothing)
            .Text = CStr(MeanValue)
            .Text = CStr(MeanValue)
            .Overlay = Overlays.OverlayType.AnnotationsOverlay
            .ApplyTo = Overlays.ShapeAction.NewGraphicObject
            .Location = New System.Drawing.PointF(10,MeanPosition-40)
            .Size = New System.Drawing.SizeF(90,40)
            .Run(ThisApplication.ActiveDocument)
        End With

But I also want to set the font, colour etc. How can I do it? 

Best Answers

  • Options
    Answer ✓
    Hi Paul,

    Take a look on the properties of the [Select].Annotations.ShapeCommands.Text command. It includes all Text related or try to record a macro:

        Public Function AddText() As SimpleScript
            AddText = New SimpleScript
            Dim image1
    
            With Application.DocumentCommands.ActiveImage(AddText)
                .Run(image1)
            End With
    
            With [Select].Annotations.ShapeCommands.Text(AddText)
                .Overlay = Overlays.OverlayType.AnnotationsOverlay
                .ApplyTo = Overlays.ShapeAction.NewGraphicObject
                .AngleOfRotation = 0R
                .BorderColor = System.Drawing.Color.Yellow
                .BorderWidth = 1
                .BorderStyle = Overlays.BorderStyle.Solid
                .CornersStyle = Overlays.CornersStyle.Mitered
                .FillColor = System.Drawing.Color.FromArgb(CType(255, Byte),CType(255, Byte),CType(128, Byte))
                .BorderVisible = False
                .FillVisible = True
                .FrameEnd = -1
                .FrameStart = 0
                .Layer = 0
                .Opacity = 100
                .Selected = True
                .ZoomWithImage = True
                .ZoomWithImageLimit = 0R
                .Location = New System.Drawing.PointF(62.47226F,50.93153F)
                .Visible = True
                .Alignment = MediaCy.IQL.Display.Overlays.mcGraphObjTextAlignment.mcgtaLeft
                .AutoSize = False
                .Font = New System.Drawing.Font("Arial",15F,System.Drawing.FontStyle.Regular,System.Drawing.GraphicsUnit.Point,CType(0, Byte))
                .Shadow = False
                .Size = New System.Drawing.SizeF(154.0437F,108.3825F)
                .TextColor = System.Drawing.Color.Black
                .CalloutLine = False
                .Run(image1)
            End With
    
        End Function

    Thanks,
    Nikita.

  • Options
    Answer ✓
    Paul,

    Nikita is referring to the Properties window of the project workbench when the command is selected in the Designer mode, right after recording:



    Yuri

Answers

Sign In or Register to comment.