private Point[] createTrianglePoints() { int[] clientMiddle = { (ClientSize.Width / 2), (ClientSize.Height / 2) }; int size = ExpositionController.CentimeterToPixel(executingTest.ProgramInUse.StimuluSize, this); int heightTriangle = size; Point screenPosition = this.ScreenPosition(new Size(heightTriangle, heightTriangle)); screenPosition.X -= heightTriangle / 3; screenPosition.Y += heightTriangle / 2; Point point1 = new Point(screenPosition.X + (heightTriangle / 3), (heightTriangle / 2) + screenPosition.Y); Point point2 = new Point((8 * heightTriangle / 6) + screenPosition.X, (heightTriangle / 2) + screenPosition.Y); Point point3 = new Point(((heightTriangle / 2)) + screenPosition.X + (heightTriangle / 3), ((heightTriangle / 2)) + screenPosition.Y - heightTriangle); Point[] trianglePoints = { point1, point2, point3 }; return(trianglePoints); }
private void drawCircleShape() { int size = ExpositionController.CentimeterToPixel(executingTest.ProgramInUse.StimuluSize, this); float widthEllipse = size; float heightEllipse = size; Pen myPen = new Pen(ColorTranslator.FromHtml(colorsList[colorCounter])); Graphics formGraphicsEllipse = CreateGraphics(); Point screenPosition = this.ScreenPosition(new Size((int)widthEllipse, (int)heightEllipse)); float xEllipse = screenPosition.X; float yEllipse = screenPosition.Y; formGraphicsEllipse.DrawEllipse(myPen, xEllipse, yEllipse, widthEllipse, heightEllipse); formGraphicsEllipse.Dispose(); colorCounter++; if (colorCounter == colorsList.Length) { colorCounter = 0; } }
// draw on screen filled square stimulus private void drawFullSquareShape() { int size = ExpositionController.CentimeterToPixel(executingTest.ProgramInUse.StimuluSize, this); float widthSquare = size; float heightSquare = size; SolidBrush myBrush = new SolidBrush(ColorTranslator.FromHtml(colorsList[colorCounter])); Graphics formGraphicsSquare = CreateGraphics(); Point screenPosition = this.ScreenPosition(new Size((int)widthSquare, (int)heightSquare)); float xSquare = screenPosition.X; float ySquare = screenPosition.Y; formGraphicsSquare.FillRectangle(myBrush, xSquare, ySquare, widthSquare, heightSquare); formGraphicsSquare.Dispose(); colorCounter++; if (colorCounter == colorsList.Length) { colorCounter = 0; } }