MapInfo Pro

Expand all | Collapse all

Problem programming translucency in layers

  • 1.  Problem programming translucency in layers

    Posted 08-15-2019 05:18

    I have written a MapBasic program which creates a custom layout workspace in MapInfo 17.03 - This all works fine until I added translucency via the "Alpha" setting

    Whilst the Alpha command is clearly in the workspace and selecting the properties of the layer states it is 50% translucent - it is still displaying at 100% solid - altering the translucency in MapInfo immediately activates it and subsequent a save retains the setting and displays correctly on re-opening - which looks almost identical to the original created workspace - any ideas how to get the layer to appear translucent



    ------------------------------
    Craig
    Staffordshire Ecological Record
    http://www.staffs-ecology.org.uk
    ------------------------------


  • 2.  RE: Problem programming translucency in layers

    Posted 08-15-2019 23:01
    Hi Craig,

    Have you switched on enhanced rendering for the window?

    Set Window [win_id] Enhanced On


    ------------------------------
    Timothy Mashford
    Knowledge Community Shared Account
    Shelton CT
    ------------------------------



  • 3.  RE: Problem programming translucency in layers

    Posted 08-16-2019 02:44
    Hi Tom,

    Yes it is on

    Craig

    ------------------------------
    Craig Slawson
    Knowledge Community Shared Account
    Shelton CT
    ------------------------------



  • 4.  RE: Problem programming translucency in layers

    Pitney Bowes
    Posted 08-16-2019 09:05
    Hi Craig,

    As mentioned earlier, you definitely need Enhanced Rendering to be On when using translucency/alpha. But you said that has already been set.

    A layout that has a map frame will actually have 2 "windows". You will have one window for the layout and one for the map frame. Can you confirm that you have set the Alpha and Enhanced Rendering on for the map frame window (not the layout window).

    One more thought... Do you have any theme layers in that map frame? If so, are you setting the alpha on the theme layer or the original base layer?

    Another suggestion is to save your data that you created using your MapBasic program to a WOR. Then open that WOR in MapInfo Pro and manually set/change the translucency settings from the Explorer using Layer Properties.

    If that still doesn't work, can you send me that WOR (and related tables)? You can use the Workspace Packager tool to save all of the files to an empty directory and then zip up all of the files. If I have the WOR, I can try to help you out.

    Thanks,
    Alicia



    ------------------------------
    Alicia Levesque
    Pitney Bowes Software
    ------------------------------



  • 5.  RE: Problem programming translucency in layers

    Pitney Bowes
    Posted 08-16-2019 09:44
    Craig,

    I am attaching a simple WOR that I created. It contains a Layout with a Map frame with a single layer. This world layer is 75% translucent (alpha=63).

    Here is a snippet from my WOR showing the map window creation and the Enhanced Rendering and Alpha settings:
    Map From WORLD
    Position (0.725,0.8375) Units "in"
    Width 7.30625 Units "in" Height 4.53125 Units "in"
    Pen (1,2,0) Priority 1 Into Window uniqueLayoutWin
    Set Window WindowID(0) Front
    Set Window FrontWindow() ScrollBars Off Autoscroll Off Enhanced On Smooth Text Antialias Image High Vector Antialias
    Set Map Redraw Off
    Set Map
    CoordSys Earth Projection 12, 62, "m", 0
    Center (297499.0339,0)
    Zoom 27843.7596 Units "mi"
    Preserve Zoom Display Zoom
    Distance Units "mi" Area Units "sq mi" XY Units "m"
    Set Map
    Layer 1
    Display Global
    Global Pen (2,2,0) Brush (2,16711680,16777215) Symbol (35,0,12) Line (1,2,0) Font ("Arial",0,9,0)
    Label Line None Position Center Font ("Arial",0,9,0) Pen (1,2,0)
    With Country
    Parallel On Auto Off Overlap Off Duplicates On Offset 2
    Visibility On
    Alpha 63





    ------------------------------
    Alicia Levesque
    Pitney Bowes Software
    ------------------------------

    Attachment(s)



  • 6.  RE: Problem programming translucency in layers

    Posted 28 days ago
    Alicia

    Thanks - I think it must have been applying the enhancement to the wrong window, I have now got the program working and correctly 'dimming' the items

    Craig

    ------------------------------
    Craig Slawson
    Knowledge Community Shared Account
    Shelton CT
    ------------------------------