Getting a document bitmap to center

I’m exporting a diagram to a bitmap using GetBitmap. The target size of the bitmap is smaller than the actual size of the diagram so I use RescaleToFit() to get it to fit in the needed size. It does this fine.
However, the image isn’t centered in the bitmap. Looks a bit left-justified to me. I then used DocScale and the size of the document to calculate the actual size of the document in the view and adjust its TopLeft property. This works fine also. However, the image I get from GetBitmap() afterwards is still left-justified. Is there something else I need to do to get the document to center itself or respect the TopLeft property when it’s drawn in the view ?
Thanks
Mark

Perhaps you should just use GoView.GetBitmapFromCollection, using the overload that allows you to specify both the RectangleF in document coordinates as well as the scale.

Hi Walter,
Enhancement suggestion - modify RescaleToFit to take an enum parm that allows me to specify how I want the image positioned - Left, Center, Right, Top, Bottom, etc.
Thanks
Mark