private void progress_bar_graduations() { int height = progressBar1.Height - 1; int width = progressBar1.Width; int start_x = progressBar1.Location.X; int start_y = progressBar1.Location.Y; int ng_grad = 9; List <LineShape> list_graduation = new List <LineShape>(); canvas.Parent = panel_single; canvas.BringToFront(); //drawing a rectangle around the progress bar for homogeneity LineShape border1 = new LineShape(); LineShape border2 = new LineShape(); LineShape border3 = new LineShape(); LineShape border4 = new LineShape(); border1.Parent = canvas; border2.Parent = canvas; border3.Parent = canvas; border4.Parent = canvas; border1.StartPoint = new System.Drawing.Point(start_x, start_y); border1.EndPoint = new System.Drawing.Point(start_x + width, start_y); border1.BorderColor = Color.FromArgb(179, 179, 179); border2.StartPoint = new System.Drawing.Point(start_x + width, start_y); border2.EndPoint = new System.Drawing.Point(start_x + width, start_y + height); border2.BorderColor = Color.FromArgb(179, 179, 179); border3.StartPoint = new System.Drawing.Point(start_x + width, start_y + height); border3.EndPoint = new System.Drawing.Point(start_x, start_y + height); border3.BorderColor = Color.FromArgb(179, 179, 179); border4.StartPoint = new System.Drawing.Point(start_x, start_y); border4.EndPoint = new System.Drawing.Point(start_x, start_y + height); border4.BorderColor = Color.FromArgb(179, 179, 179); //we iteratively draw the nb_grad graduations for (int i = 0; i < ng_grad; i++) { LineShape graduation = new LineShape(); graduation.Parent = canvas; graduation.StartPoint = new System.Drawing.Point(start_x + (i + 1) * (width / (ng_grad + 1)), start_y); graduation.EndPoint = new System.Drawing.Point(start_x + (i + 1) * (width / (ng_grad + 1)), start_y + height); graduation.BorderColor = Color.FromArgb(179, 179, 179); list_graduation.Add(graduation); } }
private void InitializeMap() { ReadMap readMap = new ReadMap(); readMap.mapFile = VisualizerGlobal.MapInfo.FileName; readMap.Load(); MapImage.Image = VisualizerGlobal.ClippingMap; Canvas.Parent = MapImage; Canvas.BringToFront(); MapDetailsLabel.Text = $"Map Name: {VisualizerGlobal.MapInfo.Title} Width: {VisualizerGlobal.ClippingMap.Width} Height: {VisualizerGlobal.ClippingMap.Height}"; }
private void InitializeMap() { ReadMap readMap = new ReadMap { mapFile = VisualizerGlobal.MapInfo.FileName }; readMap.Load(); MapImage.Image = VisualizerGlobal.ClippingMap; Canvas.Parent = MapImage; Canvas.BringToFront(); MapDetailsLabel.Text = string.Format("Map Name: {0} Width: {1} Height: {2}", VisualizerGlobal.MapInfo.Title, VisualizerGlobal.ClippingMap.Width, VisualizerGlobal.ClippingMap.Height); }