In my Forms application i tried to resize a pictureBox control during runtime
and it seems to give some trouble. There is scale factor scalex , scaley which i applied
to the width and height property of the control.
tempw = 980.0f; temph = 130.0f; tempw = float.Parse(pictureBox1.Width.ToString()); temph = float.Parse(pictureBox1.Height.ToString()); tempw = pictureBox1.Width; temph = pictureBox1.Height; pictureBox1.Width = (int)(tempw * scaleX); pictureBox1.Height =(int)(temph * scaleY);
when i use lines 1&2 there is no problem but when i use lines 3&4 or 5&6 the box expands
to a large value and i get a "out of memory exception".All my variables are float values.But during debug the value of final Width, Height values seem to be what i expected.
Edited 6 Years Ago by deepak_1706: n/a