I am rendering some objects as a scene. After i am done displaying it i want to save it as JPEG file.
I am able to save it to JPEG file by reading pixels by using glReadPixels() method.
Considering i know the bounding rectangle of my object being displayed, now i want to save the JPG file as fixed dimension ( M X N) where M and N will be constant and also i want my object to cover large area with some frame on it.
If I want image of dimension 20002000 and my object bounding rectangle is 700550 then i want to scale that to 1800*1800 and remaining outer pixels as the border of image.
How can i achieve this?