public static void plotGazeDataList(List <Point> gazeDataDoubleList, EyeOption eyeSelected, Color gazeColor, int gazeDotRadius, Form formulario, PictureBox pictureBoxStimulus, Size stimulusSize, Point stimulusLocation) { for (var indiceSample = 0; indiceSample < gazeDataDoubleList.Count; indiceSample++) { plotDot(gazeDataDoubleList[indiceSample].X, gazeDataDoubleList[indiceSample].Y, eyeSelected, gazeColor, gazeDotRadius, formulario, pictureBoxStimulus, stimulusSize, stimulusLocation); } }
public static void plotFixDataList(List <Point> fixDataList, EyeOption eyeSelected, Color fixColor, int fixDotRadius, Form formulario, PictureBox pictureBoxStimulus, Size stimulusSize, Point stimulusLocation) { for (var indiceSample = 0; indiceSample < fixDataList.Count; indiceSample++) { plotDot(fixDataList[indiceSample].X, fixDataList[indiceSample].Y, eyeSelected, fixColor, fixDotRadius, formulario, pictureBoxStimulus, stimulusSize, stimulusLocation); } }
public static void plotDot(int dotX, int dotY, EyeOption eyeSelected, Color dotColor, int dotRadius, Form formulario, PictureBox pictureBoxStimulus, Size stimulusSize, Point stimulusLocation) { //posicion relativa a la esquina superior izquierda del pictureBoxStimulus int dotXrelative = (int)((double)(dotX - stimulusLocation.X) * (double)pictureBoxStimulus.Size.Width / (double)stimulusSize.Width); int dotYrelative = (int)((double)(dotY - stimulusLocation.Y) * (double)pictureBoxStimulus.Size.Height / (double)stimulusSize.Height); //bool dotOverPictureBox = isDotOverPictureBox(new Point(dotX, dotY), stimulusSize, stimulusLocation); //SolidBrush brush; //Graphics newGraphics; //Rectangle rect; //Point dPoint; //se grafican tanto sobre el picturebox como sobre el form que total si no se puede no grafica //if (dotOverPictureBox) { SolidBrush brush; Graphics newGraphics; Rectangle rect; Point dPoint; brush = new SolidBrush(dotColor); newGraphics = Graphics.FromHwnd(pictureBoxStimulus.Handle); dPoint = new Point(dotXrelative - dotRadius, dotYrelative - dotRadius); rect = new Rectangle(dPoint, new Size(2 * dotRadius, 2 * dotRadius)); if (eyeSelected == EyeOption.Left) { newGraphics.FillRectangle(brush, rect); } else { newGraphics.FillEllipse(brush, rect); } newGraphics.Dispose(); } //else { SolidBrush brush; Graphics newGraphics; Rectangle rect; Point dPoint; //brush = new SolidBrush(Color.Black); brush = new SolidBrush(dotColor); newGraphics = formulario.CreateGraphics(); dPoint = new Point(dotXrelative + pictureBoxStimulus.Location.X - dotRadius, dotYrelative + pictureBoxStimulus.Location.Y - dotRadius); rect = new Rectangle(dPoint, new Size(2 * dotRadius, 2 * dotRadius)); if (eyeSelected == EyeOption.Left) { newGraphics.FillRectangle(brush, rect); } else { newGraphics.FillEllipse(brush, rect); } newGraphics.Dispose(); } //newGraphics.FillEllipse(brush, rect); //newGraphics.Dispose(); }