Always center horizontaly, and add top margin. If print-preview, resolution doesn't change, so keep current DIB size. New RC will be created for our temp. If this objects are large and may take up the whole memory, we should also delete the objects from window RC, so there is no double copy of the objects in memory. What policy you will use will probably depend on your particular application.
Image is ready.
Restore the viewport. Draw the surface to a printing metafile. It is not needed for printout, but is needed for print-preview, and may be needed by other application which capture the metafile.