Neco/LandView/GraphicsEngine.cs
/// <summary>Creates an image with a Country and all its districts and roads</summary>
/// <param name="C"></param>
/// <returns></returns>
Creates an image with a Country and all its districts and roads
Creates an image with a Country and all its districts and roads
public static Image GenerateCountryImage(Country C) {
            try {
                if (C.Width == 0 || C.Height == 0) { return GenerateErrorImage($"Country {C.Name} ({C.ID})\nHas a width or height of 0 and cannot be drawn."); }
                Image I = GenerateCanvas(C);
                Point Origin = GetOrigin(C);
                Graphics GRM = Graphics.FromImage(I);
#if (DEBUG)
                DrawOriginCrosshair(Origin, GRM);
#endif
                DrawRoads(C, GRM, Origin);
                DrawDistricts(C, GRM, Origin);
                return I;
            } catch (Exception E) {
                return GenerateErrorImage($"{E.Source} at {E.TargetSite}:\n{E.Message}\n{E.StackTrace}");
            }
        }
public static Image GenerateCountryImage ( Country C ) { try { if ( C . Width == 0 || C . Height == 0 ) { return GenerateErrorImage ( $" Country  { C . Name }  ( { C . ID } ) \n Has a width or height of 0 and cannot be drawn. " ) ; } Image I = GenerateCanvas ( C ) ; Point Origin = GetOrigin ( C ) ; Graphics GRM = Graphics . FromImage ( I ) ; if ( DEBUG ) DrawOriginCrosshair ( Origin , GRM ) ; endif DrawRoads ( C , GRM , Origin ) ; DrawDistricts ( C , GRM , Origin ) ; return I ; } catch ( Exception E ) { return GenerateErrorImage ( $" { E . Source }  at  { E . TargetSite } : \n { E . Message } \n { E . StackTrace } " ) ; } }
Creates an image with a Country and all its districts and roads
Creates an image with a Country and all its districts and roads
//This is the only check we need //Find the point that's 0,0 //Draw a little cross at the center //Draw each district
None
C
Country
None