Ejemplo n.º 1
0
 // Display the image and points of interest
 private void mapImage_Paint(object sender, PaintEventArgs e)
 {
     MapDrawing.DrawImageCenter(e.Graphics, _baseImage, _imageCenter, _imageSize);
     e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
     MapDrawing.DrawPointsOfInterest(e.Graphics, _imageCenter, _imageSize, displayTownsCheck.Checked, displayJobsCheck.Checked, displayShopsCheck.Checked, displayLocationsCheck.Checked);
     MapDrawing.DrawRoadHazards(e.Graphics, _imageCenter, _imageSize, displayRoadHazardsCheck.Checked, displayTrafficHazardsCheck.Checked, displayRailwayHazardsCheck.Checked, displayHazardsCheck.Checked, displayHazardsCheck.Checked);
     if (_selectedPoi != null)
     {
         MapDrawing.DrawCross(e.Graphics, new Pen(Color.Black, 1.0f), _selectedPoi.MapLocation(_imageCenter, _imageSize), mapImage.Size);
     }
     if (_gpsData.Success)
     {
         if (Car.Checked)
         {
             MapDrawing.DrawImg(e.Graphics, _gpsData.MapPosition, _gpsData.Heading, _imageCenter, _imageSize, _carPath);
         }
     }
     if (_gpsData.PX != 0)
     {
         MapDrawing.DrawArrow(e.Graphics, _gpsData.PlayerPosition, _gpsData.PHeading, _imageCenter, _imageSize, Color.Blue, Player.Checked);
     }
     if (_gpsData.TX != 0 & train.Checked)
     {
         MapDrawing.DrawImg(e.Graphics, _gpsData.TrainPosition, 0, _imageCenter, _imageSize, _trainPath);
     }
 }