Lep
❔ Auto Resize
I'm attempting a little learning project and was wondering if I could get some help on the following:
How can I get the automatically resized width of the new img?
My current main window has a capped height of 300. The width is auto and the img has an auto height and width so it scales to the 300 pixel height. If I manually change the main window width size everything works perfectly fine.
I tried the following but it didn't seem to work:
MainWin.Width = (MainWin.Height / img.ActualHeight) * img.ActualWidth;
which would give me 146.25 to be the correct width. It works if I insert the size manually, but it doesn't work if I use the equation to set the size.
I've also tried:
The commented out section seems to work fine but the bottom doesn't, I also tried to change "ActualWidth/Height" to just normal.9 replies