public void PlotAxis(DataSeris ds, int X0, int Y0, double scaleX, double scaleY) { x += x0 - X0; y += y0 - Y0; sx = sx + sX - scaleX; sy = scaleY; Gl.glColor3f(0.882f, 0.572f, 0.094f); Gl.glTranslated(x, y, 0); Gl.glScaled(sx, sy, 1); Gl.glScaled(sx, sy, 1); Gl.glLineWidth(1); Gl.glBegin(Gl.GL_LINES); // далее мы рисуем координатные оси и стрелки на их концах //Y Gl.glVertex2d(-widthY, hightWindow / 2); Gl.glVertex2d(-widthY, -hightWindow / 2 + highX); //X Gl.glVertex2d(-widthWindow, -hightWindow / 2 + highX); Gl.glVertex2d(-widthY, -hightWindow / 2 + highX); x0 = X0; y0 = Y0; sX = scaleX; sY = scaleY; // завершаем режим рисования Gl.glEnd(); }
// ------------------------------ End Данные--------------------------------- // Конструкторы public Paint(DataSeris ds, SimpleOpenGlControl p, int scX, int scY) { Ant = p; tf = ds.TFrame; widthCl = Convert.ToByte(scX); hightCl = Convert.ToByte(scY); // countBarDraw = Convert.ToUInt16((p.Size.Width - Axis.widthY)/widthCl); //countBars = ds.Bars.Count; delta = ds.deltaTick; // start.X = Ant.Size.Width - Axis.widthY - widthCl; // start.Y = (Ant.Height - Axis.highX)/2; startPrice = ds.Bars.Last().Value.Close; axis = new Axis(Ant); //bars = ds; }