In a MFC SDI application containing a single CView
, I pass the output device context pDC->m_hDC
to a mapping library to render the map within the CMyView::OnDraw()
method.
I would like the rendered image to appear in the centre of the cview surrounded by a black background, i.e. the image size would be smaller than the CView
client rect size. I have experimented with CDC::SetViewportOrg()
and set the device size in the mapping library, however unfortunately the mapping library draws outside of the device size set.
What is the best way of limiting the image to the desired size? Should I be looking at clipping functions? Or do I have to manually draw over the undesired parts of the image.