Example #1
0
            public Overlay ToOverlay(int maxX, int maxY, string directory)
            {
                Overlay overlay;

                if (!string.IsNullOrWhiteSpace(Path))
                {
                    overlay = Type == "flag"
                                                ? OverlayFactory.GetFlagInstance(Path, maxX, maxY)
                                                : OverlayFactory.GetImageInstance(Path, directory, maxX, maxY);
                }
                else
                {
                    overlay = OverlayFactory.GetInstance(Type, maxX, maxY);
                }

                if (overlay == null)
                {
                    return(null);
                }

                overlay.SetColor(Color);
                overlay.SetValues(Values);

                var path = overlay as OverlayPath;

                if (path != null)
                {
                    path.StrokeColor = StrokeColor;
                }

                return(overlay);
            }