This content has been marked as final. Show 5 replies
It's a ratio so...
MaxHeight/MaxWidth = Height/Width ....
Assuming you were to force one of them to the max width or height everytime...
_mw / _mh = _xw / _oh - For the 850x450 image....
382 / 246 = _xw / 450 or ..... _xw = (382 / 246) / 450
In terms of variables....
_xw = ( _mw / _mh ) / _oh;
picHolder._width = _xw;
picHolder._height = _mh;
when loading has completed:
thank you for your reply Sym,
I try your formula>
stageW = 382
stageH = 246
my image A is 850x450
myW = (382/246)/450
gives me myW = 0.00345< so if I multiply with 100000 gives me myW 345.
would be ok, but a image for ex 799x335 jumps out of my frame.?
this works perfect. Worked already 2 days on this.
Just need to fix the x + y alignment to be centred in the frame.
I think, I can make it.
Thank you very much for the help.
Great as always.
you're welcome. here's the code with centering: