DigiPara Liftdesigner LDX API
Loading...
Searching...
No Matches
Add an image annotation

API method: ILDXSheetFrameText5.SheetFrameTextMode

Treename: Sheets.LdvSheet1.LdvFrame2.Map.NOTE#LD API example - Sheet frame image

 ' from Samples/Src/LDXAPIExamples/Example_LDXSheetFrameTexts.vb

    <APIHelpAttribute(APIHelpModes.FireCalcModel Or APIHelpModes.LoadLD3File, {APIHelpModes.InputParaLDXDoc, APIHelpModes.InputParaPoolWithOtherFileName, "Bmp\LDToolbar\digipara_logo.png"}, "Sheets.LdvSheet1.LdvFrame2.Map.NOTE#LD API example - Sheet frame image", "LDXSheetFrameText~SheetFrameTextMode", "Add an image annotation")>
    Public Shared Sub AddAnImageAnnotation(ByRef ldxDocument As DigiPara.LDX.LDXDocument, imagePath As String)

        If ldxDocument.GetObject("Sheets.LdvSheet1.LdvFrame2.Map.") Is Nothing Then
            MsgBox("Desired sheet frame texts frame not found! Please reload the relevant .ld3 file.")
            Exit Sub
        End If

        Dim ldxSheetFrameTexts As DigiPara.LDX.LDXSheetFrameTexts = DirectCast(ldxDocument.GetLDXObject("Sheets.LdvSheet1.LdvFrame2.Map.").LDXType, DigiPara.LDX.LDXSheetFrameTexts)
        Dim ldxSheetFrameText As DigiPara.LDX.LDXSheetFrameText = ldxSheetFrameTexts.Add("NOTE#LD API example - Sheet frame image")

        With ldxSheetFrameText
            ' The path to the image
            .Text = imagePath
            ' The position
            .RelativePosition = DigiPara.LDX.SheetFrameTextRelativePosition.sftpTop Or DigiPara.LDX.SheetFrameTextRelativePosition.sftpLeft
            ' Set mode of the sheet frame to image
            .SheetFrameTextMode = DigiPara.LDX.SheetFrameTextModes.sftmImage Or DigiPara.LDX.SheetFrameTextModes.sftmEmbed Or DigiPara.LDX.SheetFrameTextModes.sftmFrame
            ' The width of the image
            .Matrix.X.Length = 60
            .Matrix.Y.Length = 60
        End With

    End Sub