예제 #1
0
 private void WritePenWidth(IPenWidth symbol)
 {
     if (symbol == null)
     {
         return;
     }
     _sw.WriteLine(@"<CssParameter name=""stroke-width"">" + symbol.PenWidth.ToString(_nhi) + "</CssParameter>");
 }
예제 #2
0
        static public float PenWidth(float penWidth, IPenWidth symbol, Carto.IDisplay display)
        {
            float dpiFactor = display == null || display.dpi == 96.0f ? 1f : (float)(display.dpi / 96.0);

            if (symbol.MinPenWidth > 0f && penWidth < symbol.MinPenWidth * dpiFactor)
            {
                return(symbol.MinPenWidth * dpiFactor);
            }

            if (symbol.MaxPenWidth > 0 && penWidth > symbol.MaxPenWidth * dpiFactor)
            {
                return(symbol.MaxPenWidth * dpiFactor);
            }

            return(penWidth);
        }