CODE to CLOSE the TILING VIEW IMAGE when TILING is FINISHED . . .

2017-08-03-182519

All --

The code below was created by recording the actions illustrated by the first SCREEN CAPTURE below (in PREMIER 9.2).

When the CODE is executed, the TILING VIEW WINDOW / IMAGE remains OPEN.

I cannot determine how to close the TILING VIEW WINDOW / IMAGE.

Can one of the PREMIER GURUS direct me to the answer?

I have attached the ORIGINAL TIF IMAGES to assist in working this out.

Thanks in advance for your assistance.

-- Matt

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

    Public Function My_Tile_Images()

        Dim doc1
        Dim var1 = "A2_tif", doc2
        Dim var2 = "B2_tif", doc3, image1, doc4

        With Process.TilingCommands.[New](My_Tile_Images)
            .Run(doc1)
        End With

        With Application.DocumentCommands.Activate(My_Tile_Images)
            .Run(doc1, doc1)
        End With

        With Application.RibbonCommands.SelectRibbonTab(My_Tile_Images)
            .TabName = "TilingView"
            .Run()
        End With

        With Application.DocumentCommands.Define(My_Tile_Images)
            .Run(var1, doc2)
        End With

        With Process.TilingCommands.Add(My_Tile_Images)
            .Selection = Nothing
            .Run(doc1, doc2)
        End With

        With Application.DocumentCommands.Define(My_Tile_Images)
            .Run(var2, doc3)
        End With

        With Process.TilingCommands.Add(My_Tile_Images)
            .Selection = Nothing
            .Run(doc1, doc3)
        End With

        With Process.TilingCommands.Align(My_Tile_Images)
            .Mode = MediaCy.Addins.TilingView.McAlignMode.mcaiRows
            .FlipLeftRight = False
            .FlipTopBottom = False
            .ZOrder = False
            .Columns = 2
            .Rows = 1
            .Border = 0
            .Gap = New System.Drawing.Size(0,0)
            .Run(doc1)
        End With

        With Process.TilingCommands.Apply(My_Tile_Images)
            .BlendingMethod = MediaCy.IQL.Align.mcTileStitchingMethod.mctsmGradient
            .UseROI = False
            .Run(doc1, image1)
        End With

        With Application.RibbonCommands.SelectRibbonTab(My_Tile_Images)
            .TabName = "Process"
            .Run()
        End With

        With Application.DocumentCommands.Activate(My_Tile_Images)
            .Run(image1, doc4)
        End With

        With Application.DocumentCommands.Activate(My_Tile_Images)
            .Run(doc1, doc1)
        End With

        With Application.RibbonCommands.SelectRibbonTab(My_Tile_Images)
            .TabName = "Process"
            .Run()
        End With
        With Application.DocumentCommands.Activate(My_Tile_Images)
            .Run(doc4, doc4)
        End With

    End Function






A2.tif 27.5K
B2.tif 27.5K

Best Answers

  • Accepted Answer
    Hi Matt,

    Tiling view is a regular window and could be closed with close command:
        Public Function Open_and_Close_Tiling_View() As SimpleScript
            Open_and_Close_Tiling_View = New SimpleScript
            Dim doc1, window1
    
            With Process.TilingCommands.[New](Open_and_Close_Tiling_View)
                .Run(doc1)
            End With
    
            With Application.WindowCommands.Define(Open_and_Close_Tiling_View)
                .Run(doc1, window1)
            End With
    
            With Application.WindowCommands.Close(Open_and_Close_Tiling_View)
                .Run(window1)
            End With
    
        End Function
    Thanks,
    Nikita.
  • Accepted Answer
    Matt, tiling view is not an image (it has document and window if visible).

    Thanks,
    Nikita.

Answers

  • 2017-08-04-092136

    Nikita --

    Thank you for your assistance.

    I was using

            ThisApplication.ActiveImage.Close
    
    Based on your information, the FRAME labeled TILING VIEW is a WINDOW and does not respond to this command.

    I see that there is a

            ThisApplication.ActiveWindow.Close
    

    I'll try that and if it doesn't work I'll use your

            With Application.WindowCommands.Close(Open_and_Close_Tiling_View)
                .Run(window1)
            End With

    Thanks again.

    -- Matt
Sign In or Register to comment.