Developer Reference Overlay Tricks

Tricks to make your overlays stand out

Mostly people use ENCX to draw charts as an underlay on top of which they draw some other information, overlays. For example in the typical navigation system situation the ship and routes are overlaid onto the chart. Sometimes the chart seems a bit busy and colourful and you cannot see the wood for the trees. Here are a few tricks to have up your sleeve if you hit this problem...

Try to make your overlays stand out more:

  • Bright colours
  • Solid outlines
  • Be aware that orange is not a colour that crops up much on charts - so it is a good default overlay colour. There's something about this in the ECDIS navigation system standard as it happens.

Fade the chart

By adjusting the luminance and saturation values in the DisplayPalette object (a property of your S57Draw object) you can fade the chart to help your overlays stand out.

ENCX.S57Draw encDraw = new ENCX.S57Draw();
...
encDraw.DisplayPalette.Luminance = 1.3; // default is 1.0
encDraw.DisplayPalette.Saturation = 0.7; // default is 1.0

Here's how it looks, you can control how subtle or severe the fading is by changing the values...

Faded chart

For contrast here it is using the default values (Luminance = 1.0, Saturation = 1.0)...

Default luminance and saturation

Get the chart symbols drawn smaller

ENCX can be adjusted to suit displays of varying pixel density. These days we (Chersoft) reckon that most displays are about 100dpi.

To set ENCX for 100dpi you use the following line to set the PixelSizeMetres property on your S57Draw object:

encDraw.PixelSizeMetres = 0.000254; // 100 dpi

(For reference the calculation is this: 25.4mm is an inch. Divide this figure by 100 to get the size of a dot in mm. Then divide that by 1000 as there are 1000mm in a metre.)

So for 50dpi we need a value of 0.000508. If we make this setting and continue to use our 100 dpi monitor then ENCX will draw all the symbols half size (well half in terms of width and height, quarter size in terms of area).

This throws the scale value we have specified out. To still get the same area of planet on the same area of screen we need to double the level of detail in the scale. In ENCX you specify the ratio 1:25000 as 25000. So halving this could be considered to be doubling the scale. Scales can get very semantically confusing in this respect so we always try and talk about increasing/decreasing the detail rather than the scale as the latter can seem ambiguous.

Anyway in the code...

encDraw.PixelSizeMetres = 0.000508;
encDraw.SetDisplayScale(encDraw.DisplayScale / 2, ptCentre);

This techniques not perfect. The overscale warning, north arrow and scale bar are affected but if you turn them off no one will ever know.

DPI set for 50dpi, Scale halved to compensate

And the original for comparison...

Symbols normal size