Neco/LandView/GraphicsEngine.cs
/// <summary>Creates an image with a district and all its plots</summary>
/// <param name="D"></param>
/// <returns></returns>
Creates an image with a district and all its plots
Creates an image with a district and all its plots
public static Image GenerateDistrictImage(District D) {
            try {
                if (!LandViewUtils.ValidatePoints(D.Points, 3)) { return GenerateErrorImage($"District {D.Name} ({D.ID})\nHas an invalid Points field and cannot be drawn"); }
                Image I = GenerateCanvas(D);
                Point Origin = GetOrigin(D);
                Graphics GRM = Graphics.FromImage(I);
#if (DEBUG)
                DrawOriginCrosshair(Origin, GRM);
#endif
                if (D.Country != null) { DrawEverything(D.Country, GRM, Origin); }
                DrawDistrictOutline(D, GRM, Origin, new(Color.Red, 10));
                GRM.Dispose();
                return I;
            } catch (Exception E) {
                return GenerateErrorImage($"{E.Source} at {E.TargetSite}:\n{E.Message}\n{E.StackTrace}");
            }
        }
public static Image GenerateDistrictImage ( District D ) { try { if ( ! LandViewUtils . ValidatePoints ( D . Points , 3 ) ) { return GenerateErrorImage ( $" District  { D . Name }  ( { D . ID } ) \n Has an invalid Points field and cannot be drawn " ) ; } Image I = GenerateCanvas ( D ) ; Point Origin = GetOrigin ( D ) ; Graphics GRM = Graphics . FromImage ( I ) ; if ( DEBUG ) DrawOriginCrosshair ( Origin , GRM ) ; endif if ( D . Country != null ) { DrawEverything ( D . Country , GRM , Origin ) ; } DrawDistrictOutline ( D , GRM , Origin , new ( Color . Red , 10 ) ) ; GRM . Dispose ( ) ; return I ; } catch ( Exception E ) { return GenerateErrorImage ( $" { E . Source }  at  { E . TargetSite } : \n { E . Message } \n { E . StackTrace } " ) ; } }
Creates an image with a district and all its plots
Creates an image with a district and all its plots
//Find the point that's 0,0 //Draw a little cross at the center
None
D
District
None