Changed Colors for weights and created variable for pointsize

This commit is contained in:
glax 2023-04-22 18:34:12 +02:00
parent 601200a8d6
commit 7fd9047ac4

View File

@ -12,9 +12,9 @@ public static class Renderer
private const int ImageMaxSize = 20000;
private const float PenThickness = 3;
private static readonly Color RouteColor = Color.Red;
private static readonly Color WeightStartColor = Color.FromArgb(127, 0, 0, 255);
private static readonly Color WeightCenterColor = Color.FromArgb(127,255, 255, 0);
private static readonly Color WeightEndColor = Color.FromArgb(127,0, 255, 0);
private static readonly Color WeightStartColor = Color.FromArgb(200, 0, 0, 255);
private static readonly Color WeightCenterColor = Color.FromArgb(200,255, 255, 0);
private static readonly Color WeightEndColor = Color.FromArgb(200,0, 255, 0);
private static readonly Color RoadPrioStart = Color.FromArgb(100, 100, 100, 100);
private static readonly Color RoadPrioCenter = Color.FromArgb(255, 100, 200, 255);
private static readonly Color RoadPrioEnd = Color.FromArgb(255, 255, 180, 0);
@ -156,6 +156,8 @@ public static class Renderer
Graphics g = Graphics.FromImage(ret);
if(renderOver is null)
g.Clear(Color.White);
float pointSize = PenThickness * 1.5f;
foreach (KeyValuePair<OsmNode, double> kv in gScoreDict)
{
@ -165,9 +167,9 @@ public static class Renderer
float x = (kv.Key.coordinates.longitude - minLon) * scaleFactor;
float y = (maxLat - kv.Key.coordinates.latitude) * scaleFactor;
x -= PenThickness / 2;
y -= PenThickness / 2;
g.FillEllipse(b, x, y, PenThickness, PenThickness);
x -= pointSize / 2;
y -= pointSize / 2;
g.FillEllipse(b, x, y, pointSize, pointSize);
}
return new ValueTuple<Image, Bounds>(ret, new Bounds(minLat,minLon,maxLat,maxLon));