c# - Auto resize winform to show all of a picture -
i've got image box use preview screen shot define mouse. i'd have winform change size in accordance of size of picture. image size determined size of rectangle create using mouse, needs auto adjust.
i have image box capable sizing show whole picture, how can make winform shows whole picture box?
i tried using following, didn't work , looked @ winform settings couldn't see needed functionality require:
// "this" winform in question // imagepreview name of picture box this.width = imagepreview.width; this.height = imagepreview.height;
try this:
this.size = new size(imagepreview.height, imagepreview.width);
if form in maximized state, have convert "normal" window.
this.windowstate = formwindowstate.normal; this.size = new size(imagepreview.height, imagepreview.width);
Comments
Post a Comment