Neco/LandView/GraphicsEngine.cs
/// <summary>Generates an image with a Plot</summary>
/// <param name="P"></param>
/// <returns></returns>
Generates an image with a Plot
Generates an image with a Plot
public static Image GeneratePlotImage(Plot P) {
            try {
                if (!LandViewUtils.ValidatePoints(P.Points,0)) { return GenerateErrorImage($"Plot {P.Name} ({P.ID})\nHas an invalid Points field and cannot be drawn"); }
                Image I = GenerateCanvas(P);
                Graphics GRM = Graphics.FromImage(I);
                Point Origin = GetOrigin(P);
                if (P.District != null && P.District.Country != null) { DrawEverything(P.District.Country, GRM, Origin); }
                DrawPlotOutline(P, GRM, Origin, new(Color.Red, 5));
                GRM.Dispose();
                return I;
            } catch (Exception E) {
                return GenerateErrorImage($"{E.Source} at {E.TargetSite}:\n{E.Message}\n{E.StackTrace}");
            }
        }
public static Image GeneratePlotImage ( Plot P ) { try { if ( ! LandViewUtils . ValidatePoints ( P . Points , 0 ) ) { return GenerateErrorImage ( $" Plot  { P . Name }  ( { P . ID } ) \n Has an invalid Points field and cannot be drawn " ) ; } Image I = GenerateCanvas ( P ) ; Graphics GRM = Graphics . FromImage ( I ) ; Point Origin = GetOrigin ( P ) ; if ( P . District != null && P . District . Country != null ) { DrawEverything ( P . District . Country , GRM , Origin ) ; } DrawPlotOutline ( P , GRM , Origin , new ( Color . Red , 5 ) ) ; GRM . Dispose ( ) ; return I ; } catch ( Exception E ) { return GenerateErrorImage ( $" { E . Source }  at  { E . TargetSite } : \n { E . Message } \n { E . StackTrace } " ) ; } }
Generates an image with a Plot
Generates an image with a Plot
None
P
Plot
None