protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); if (channels <= 0) { return; } if ((Width == 0) || (Height == 0)) { return; } gridF.reScreen(sizeXLable.x + 10, Width - 10); gridY.reScreen(Height - sizeXLable.y - 10, 10); Invalidate(); }
protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); if (!ready) { return; } if ((Width == 0) || (Height == 0)) { return; } gridF.reScreen(sizeXLable.x + 10, Width - 10); gridY.reScreen(Height - sizeXLable.y - 10, sizeColLable.y + colbarHeight + 10 + 10); gridCol.reScreen(sizeColLable.x / 2 + 10, Width - sizeColLable.x / 2 - 10); double bst = (double)root.blockSize / root.waterfallSpectrum.owner.sampleRate; gridY.max = (gridY.low - gridY.high) * bst; Invalidate(); }
protected override void OnSizeChanged(EventArgs e) { base.OnSizeChanged(e); if ((Width == 0) || (Height == 0)) { return; } newSize(); x.reScreen(xleft, xright); if (dualDisplay) { y1.reScreen(yd1bottom, yd1top); y2.reScreen(yd2bottom, yd2top); } else { y1.reScreen(ysbottom, ystop); } Invalidate(); }
private void drawTo(Graphics g) { Rectangle r = new Rectangle(0, 0, Width - 1, Height - 1); if ((designW != Width) || (designH != Height)) { // ReGrid xAxis.reScreen(50, Width - 10); yAxis.reScreen(Height - 20, 5); designW = Width; designH = Height; } if (autoscale && (traces != null) && (traces.Length > 0)) { double amin, amax; amin = traces[0].tracemin; amax = traces[0].tracemax; for (int i = 1; i < traces.Length; i++) { if (traces[i].tracemin < amin) { amin = traces[i].tracemin; } if (traces[i].tracemax > amax) { amax = traces[i].tracemax; } } if (yAxis.logScale) { if (amin < 1e-12) { amin = 1e-12; } if (amax <= amin) { amax = amin * 2; } } yAxis.newRange(amin, amax); } Rectangle rdis = new Rectangle((int)xAxis.low, (int)yAxis.high, (int)(xAxis.high - xAxis.low), (int)(yAxis.low - yAxis.high)); Rectangle rframe = new Rectangle(rdis.Left - 1, rdis.Top - 1, rdis.Width + 2, rdis.Height + 2); g.DrawRectangle(framePen, rframe); for (int i = 0; i < xAxis.gridLength; i++) { float xpos = (float)xAxis.grid[i].screen; if (xAxis.grid[i].isMajor) { g.DrawLine(majorGridPen, xpos, rdis.Top, xpos, rdis.Bottom); } else { g.DrawLine(gridPen, xpos, rdis.Top, xpos, rdis.Bottom); } if (xAxis.grid[i].show) { GraphicsUtil.drawText(g, Vector.V(xpos, rdis.Bottom), gridFont, 1, xAxis.grid[i].name, 0, 2, 0, 1, Vector.X, gridFontBrush); } } for (int i = 0; i < yAxis.gridLength; i++) { float ypos = (float)yAxis.grid[i].screen; if (yAxis.grid[i].isMajor) { g.DrawLine(majorGridPen, rdis.Left, ypos, rdis.Right, ypos); } else { g.DrawLine(gridPen, rdis.Left, ypos, rdis.Right, ypos); } if (yAxis.grid[i].show) { GraphicsUtil.drawText(g, Vector.V(rdis.Left, ypos), gridFont, 1, yAxis.grid[i].name, 0, 2, 1, 0, Vector.X, gridFontBrush); } } if (traces != null) { g.SetClip(rdis); for (int i = 0; i < traces.Length; i++) { traces[i].plot(g, xAxis, yAxis); } } }