Is there a problem with the screenshot code?
@CrashMaster You can also use the Camera.onProjectionMatrixChangedObservable observable to change the projection matrix by calling Matrix.PerspectiveLH and set the width/height of the viewport used by the projection code: