Centering and keeping aspect ratio of DirectGui.DirectFrame

Thank you, that but that would be called only if the window aspect ratio is changed…
If the aspect ratio is the same lets say the resize is from 400x300 pixels to 800x600 it would not be called. I would like to keep the frameSize of the frame on screen in pixels exactly the same regardless of the size of the window.