Hi everyone! I’m excited to share with you all a couple updates!
First, I moved from circles to squares. I think the square’s edges make it more apparent what areas a user was looking at.
Second, the user has the option of displaying a visual gaze during the trial. This was meant to prevent the user being distracted of the red circle where their gaze would be.
Third, the user can now select images of any height and width. If the image size is larger than what the screen can handle, the application reduces the size of the image to fit the screen. Here’s if you’re curious to see what it looks like:
// McVey's suggested code
if (img.Height > this.ClientSize.Height || img.Width > this.ClientSize.Width) // If the height or width of the image is larger than the screen
{
int newHeight = 0;
int newWidth = 0;
if(img.Height > this.ClientSize.Height && img.Width > this.ClientSize.Width) // If both height and width are bigger than the screen
{
newHeight = this.ClientSize.Height;
newWidth = (img.Width * this.ClientSize.Height) / img.Height;
if (newWidth > this.ClientSize.Width) // If width is still bigger than the screen
{
newWidth = this.ClientSize.Width;
newHeight = (img.Height * this.ClientSize.Width) / img.Width;
}
}
else if(img.Width > this.ClientSize.Width) // If width is larger than the screen
{
newWidth = this.ClientSize.Width;
newHeight = (img.Height * this.ClientSize.Width) / img.Width;
}
else // If height is larger than the screen
{
newHeight = this.ClientSize.Height;
newWidth = (img.Width * this.ClientSize.Height) / img.Height;
}
Bitmap resizedBmp = new Bitmap(img, newWidth, newHeight);
img = resizedBmp;
}
It’s basically calculating the right proportions so I know what to reduce the size of the image to. Thank you to McVey for helping debug this.
Tomorrow, I’ll share how I improved the accuracy of my collection and the algorithm used to determine the color of each square.
Thanks for reading!
Leave a Reply