I\'m currently writing a program that requires a preview of a live display, but the preview, of course, is scaled down. However, when I scale the PictureBox
down, t
4
and 3
are both int
s, so it gets turned to 1
. Make them something floating-point:
double ratio = 4.0 / 3.0;
Note that you're also making the same mistake with Height
(it doesn't matter right now, but it will - change it to 4.0
). And if this is the actual code, why divide by four to multiply by four again?
private void FindOptimalRes(PictureBox picBox)
{
picBox.Size = new Size(Height / 3, Height / 4);
}