private void Draw() { Graphics g = Graphics.FromImage(bit); g.Clear(SystemColors.Control); try { GraphicUtil.DrawRulerY(g, lefRec, font, MaxValue, StepValue, subRow, widthLine, false); GraphicUtil.DrawRulerX(g, botRec, font, lenY, 1, 1, widthLine, false); GraphicUtil.DrawGrid(g, chartRec, penGrid, penSubLineGrid, lenY, 1, MaxValue, StepValue, subRow, 1); GraphicUtil.DrawLineChart(g, chartRec, data, penChart, MaxValue, 0, 0); } catch (Exception) { Debug.WriteLine(" Line Viewer: Draw Through Exception"); } }
private void UpdateSize() { Graphics myGraphics = this.CreateGraphics(); recRegion = myGraphics.VisibleClipBounds; bitWave = new Bitmap((int)recRegion.Width, (int)recRegion.Height); gWave = Graphics.FromImage(bitWave); gWave.Clear(this.BackColor); GraphicUtil.DrawBorderRec(gWave, recRegion, new Pen(Color.DarkBlue)); bitChart = new Bitmap((int)recRegion.Width, (int)recRegion.Height); bitChart.MakeTransparent(); gChart = Graphics.FromImage(bitWave); gChart.Clear(Color.Transparent); //bitChartB = new Bitmap((int)recRegion.Width, (int)recRegion.Height); //bitChartB.MakeTransparent(); gChartB = Graphics.FromImage(bitWave); gChartB.Clear(Color.Transparent); bitL = new Bitmap((int)recRegion.Width, (int)recRegion.Height); bitL.MakeTransparent(); gL = Graphics.FromImage(bitL); gL.Clear(Color.Transparent); bitR = new Bitmap((int)recRegion.Width, (int)recRegion.Height); bitR.MakeTransparent(); gR = Graphics.FromImage(bitR); gR.Clear(Color.Transparent); widthOfBar = recRegion.Width; hightOfSlider = recRegion.Height; leftLimit = recRegion.X + marginSlider; rightLimit = recRegion.X + recRegion.Width - widthOfSlider - marginSlider; leftSliderPoint = leftLimit; rightSliderPoint = rightLimit; rightRec.X = rightSliderPoint; rightRec.Height = hightOfSlider; leftRec.X = leftSliderPoint; leftRec.Height = hightOfSlider; }