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