14,424,458 members

# C#

 Re: best design for an responsibility system KhaledMohammad11-Dec-19 2:03 KhaledMohammad 11-Dec-19 2:03
 Re: best design for an responsibility system F-ES Sitecore10-Dec-19 23:35 F-ES Sitecore 10-Dec-19 23:35
 Re: best design for an responsibility system KhaledMohammad11-Dec-19 2:04 KhaledMohammad 11-Dec-19 2:04
 C# VSTO Powerpoint add Text as Field Member 1357643710-Dec-19 20:10 Member 13576437 10-Dec-19 20:10
 Sending Bulk SMS using Multi Threading meeram399-Dec-19 19:41 meeram39 9-Dec-19 19:41
 Re: Sending Bulk SMS using Multi Threading OriginalGriff9-Dec-19 21:50 OriginalGriff 9-Dec-19 21:50
 Re: Sending Bulk SMS using Multi Threading jkirkerx10-Dec-19 14:20 jkirkerx 10-Dec-19 14:20
 C# GMap: How to draw arc on a map Member 139442409-Dec-19 10:03 Member 13944240 9-Dec-19 10:03
 `Hello, how can I add a polygon to the map as in the picture below? From a certain point of coordinates should open a polygon long, for example, 1 kilometer and a 120-degree opening angle.` https://i.ibb.co/ZLKgvJs/image.png[^] `My code can only draw a circle. Can it be changed so that it can draw a polygon from a certain point of coordinates with an indication of the direction, distance of drawing and the angle of aperture?` ```private void CreateCircle(Double lat, Double lon, double radius, int ColorIndex) { GMapOverlay markers = new GMapOverlay(mygmap, "markers"); PointLatLng point = new PointLatLng(lat, lon); int segments = 1080; List gpollist = new List(); for (int i = 0; i < segments; i++) { gpollist.Add(FindPointAtDistanceFrom(point, i * (Math.PI / 180), radius / 1000)); } GMapPolygon polygon = new GMapPolygon(gpollist, "Circle"); switch (ColorIndex) { case 1: polygon.Fill = new SolidBrush(Color.FromArgb(80, Color.Red)); break; case 2: polygon.Fill = new SolidBrush(Color.FromArgb(80, Color.Orange)); break; case 3: polygon.Fill = new SolidBrush(Color.FromArgb(20, Color.Aqua)); break; default: MessageBox.Show("No search zone found!"); break; } polygon.Stroke = new Pen(Color.Red, 1); markers.Polygons.Add(polygon); mygmap.Overlays.Add(markers); } public static GMap.NET.PointLatLng FindPointAtDistanceFrom(GMap.NET.PointLatLng startPoint, double initialBearingRadians, double distanceKilometres) { const double radiusEarthKilometres = 6371.01; var distRatio = distanceKilometres / radiusEarthKilometres; var distRatioSine = Math.Sin(distRatio); var distRatioCosine = Math.Cos(distRatio); var startLatRad = DegreesToRadians(startPoint.Lat); var startLonRad = DegreesToRadians(startPoint.Lng); var startLatCos = Math.Cos(startLatRad); var startLatSin = Math.Sin(startLatRad); var endLatRads = Math.Asin((startLatSin * distRatioCosine) + (startLatCos * distRatioSine * Math.Cos(initialBearingRadians))); var endLonRads = startLonRad + Math.Atan2(Math.Sin(initialBearingRadians) * distRatioSine * startLatCos, distRatioCosine - startLatSin * Math.Sin(endLatRads)); return new GMap.NET.PointLatLng(RadiansToDegrees(endLatRads), RadiansToDegrees(endLonRads)); } public static double DegreesToRadians(double degrees) { const double degToRadFactor = Math.PI / 180; return degrees * degToRadFactor; } public static double RadiansToDegrees(double radians) { const double radToDegFactor = 180 / Math.PI; return radians * radToDegFactor; }```
 Re: C# GMap: How to draw arc on a map Luc Pattyn9-Dec-19 10:40 Luc Pattyn 9-Dec-19 10:40
 Which object's destructor is getting called in vector? _PitrakSarkar_9-Dec-19 2:59 _PitrakSarkar_ 9-Dec-19 2:59
 Re: Which object's destructor is getting called in vector? Richard Deeming9-Dec-19 3:06 Richard Deeming 9-Dec-19 3:06
 Re: Which object's destructor is getting called in vector? Richard MacCutchan9-Dec-19 4:56 Richard MacCutchan 9-Dec-19 4:56
 Write program Wpf C# calculator (OEE ) Member 146803725-Dec-19 22:39 Member 14680372 5-Dec-19 22:39
 Re: Write program Wpf C# calculator (OEE ) Richard MacCutchan5-Dec-19 23:32 Richard MacCutchan 5-Dec-19 23:32
 Re: Write program Wpf C# calculator (OEE ) OriginalGriff5-Dec-19 23:41 OriginalGriff 5-Dec-19 23:41
 C# Passing password to Web API Kevin Marois5-Dec-19 10:00 Kevin Marois 5-Dec-19 10:00
 Re: C# Passing password to Web API Richard Deeming5-Dec-19 10:06 Richard Deeming 5-Dec-19 10:06
 Naudio C# ASP.net Using MPG Video Member 1394308730-Nov-19 0:45 Member 13943087 30-Nov-19 0:45
 Re: Naudio C# ASP.net Using MPG Video Gerry Schmitz2-Dec-19 6:15 Gerry Schmitz 2-Dec-19 6:15
 Re: Naudio C# ASP.net Using MPG Video jkirkerx2-Dec-19 10:30 jkirkerx 2-Dec-19 10:30
 DrawString with opacity option not print properly Le@rner29-Nov-19 20:19 Le@rner 29-Nov-19 20:19
 Re: DrawString with opacity option not print properly OriginalGriff29-Nov-19 21:17 OriginalGriff 29-Nov-19 21:17
 Re: DrawString with opacity option not print properly Le@rner29-Nov-19 21:28 Le@rner 29-Nov-19 21:28
 Re: DrawString with opacity option not print properly OriginalGriff29-Nov-19 22:16 OriginalGriff 29-Nov-19 22:16
 Re: DrawString with opacity option not print properly Le@rner29-Nov-19 22:23 Le@rner 29-Nov-19 22:23
 Last Visit: 21-Jan-20 21:49     Last Update: 21-Jan-20 21:49 Refresh « Prev1...3456789101112 Next »