/// <summary> /// Draw locations, begin and end points onto the turn inspector /// </summary> /// <param name="image">image of the turn map</param> /// <param name="path">current turn</param> /// <returns>image with points drawn on the map</returns> private void drawOnTurnMap(ref Image image, TrackPath path) { _turnMapFid.processImage((Bitmap)image); //if the fiducial strategy class has located the balloons //register the image to the UTM locations (UL, LR) _pd is our instance of PathDrawer if (_turnMapFid.MapLocated) { _turnMapFid.setCorrespondence(path.UpperLeft, path.LowerRight); _turnMapPainter.drawLocations(ref image, path.GeocodeLocations.ToArray()); Location begin = path.GeocodeLocations[0]; Location end = path.GeocodeLocations[path.GeocodeLocations.Count - 1]; _turnMapPainter.drawBeginAndEndPoints(ref image, begin, end); } }
/// <summary> /// returns the image of the ride map /// </summary> public Image getRideMap(bool downloadNew, int height, int width) { Image mapImage = null; _mapSize = width.ToString() + "x" + height.ToString() + "&"; // download web image if (_path != null && _path.Locations.Count > 0 && width != 0 && height != 0) { if (downloadNew) { _mapImage = _web.downloadImage(_baseMapUrl + _mapSize + _path.getPathUrlString() + "&sensor=false"); if (_mapImage == null) { _status = _web.Status; } else { _mapImage = new Bitmap(_mapImage); _rideMapFid.processImage((Bitmap)_mapImage); if (_rideMapFid.MapLocated) { _rideMapFid.setCorrespondence(_path.UpperLeft, _path.LowerRight); } } } if (_mapImage != null) { mapImage = new Bitmap(_mapImage); drawnOnRideMap(ref mapImage, _path); } } else { mapImage = _web.downloadImage(_baseMapUrl + _mapSize + "&sensor=false"); if (_mapImage == null) { _status = _web.Status; } } _drawnOnMapImage = mapImage; return(mapImage); }