I have a window in which I display an image. I want the user to be able to resize this window, but keep it in the same aspect ratio as the image, so large blank areas do not appear in the window.
What I tried looks like this in the OnResize event:
DragWidth := Width; DragHeight := Height; //Calculate corresponding size with aspect ratio //... //Calculated values are now in CalcWidth and CalcHeight Width := CalcWidth; Height := CalcHeight;
The problem is that while dragging the window, there is a drag between the original size and the calculated size, since the OnResize event is called afaik after the resizing has already been done (and drawn once).
Do you know any decision that you have a smooth change in the proportions?
Thanks for any help.
Marks
source share