Exemple #1
0
        private Bitmap PaintBackground(Rectangle canvasRectangle, Rectangle gameRectangle)
        {
            var canvas = new Bitmap(canvasRectangle.Width, canvasRectangle.Height);

            using (var g = Graphics.FromImage(canvas))
            {
                using (var backgroundBrush = new SolidBrush(Settings.BackgroundColor))
                {
                    g.FillRectangle(backgroundBrush, canvasRectangle);
                }

                var calcVillagesToDisplay = new DisplayVillageCalculator(Dimensions, gameRectangle, canvasRectangle);
                foreach (var village in calcVillagesToDisplay.GetVillages())
                {
                    Paint(g, village.GameLocation, new Rectangle(village.MapLocation, Dimensions.Size));
                }

                var continentDrawer = new ContinentLinesPainter(g, Settings, Dimensions, gameRectangle, canvasRectangle);
                continentDrawer.DrawContinentLines();
            }
            return(canvas);
        }
Exemple #2
0
        private Bitmap PaintBackground(Rectangle canvasRectangle, Rectangle gameRectangle)
        {
            var canvas = new Bitmap(canvasRectangle.Width, canvasRectangle.Height);
            using (var g = Graphics.FromImage(canvas))
            {
                using (var backgroundBrush = new SolidBrush(Settings.BackgroundColor))
                {
                    g.FillRectangle(backgroundBrush, canvasRectangle);
                }

                var calcVillagesToDisplay = new DisplayVillageCalculator(Dimensions, gameRectangle, canvasRectangle);
                foreach (var village in calcVillagesToDisplay.GetVillages())
                {
                    Paint(g, village.GameLocation, new Rectangle(village.MapLocation, Dimensions.Size));
                }

                var continentDrawer = new ContinentLinesPainter(g, Settings, Dimensions, gameRectangle, canvasRectangle);
                continentDrawer.DrawContinentLines();
            }
            return canvas;
        }