Archived

This topic is now archived and is closed to further replies.

Thrump

Getting DC height and width

Recommended Posts

void OglView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CClientDC dc( this );
CRect rect;
GetClientRect( rect );
CDC dcMem;

dcMem.CreateCompatibleDC( & dc );

// grab anything you like here, now dcMen contains
// a copy of the current device context for the
// view you have called the onsize message

dcMem.DeleteDC( );

Mx = ( float )( rect.right - rect.left ) ;
My = ( float )( rect.bottom - rect.top ) ;



}



Share this post


Link to post
Share on other sites