How to find out DC's dimensions?

前端 未结 6 1002
一向
一向 2020-12-31 05:53

Let\'s say I have a handle to device context (naturally, in Windows environment):

HDC hdc;

How can I get the width and height of it?

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-31 06:24

    As a disclaimer, I know nothing about GDI or what you have to work with in your application. I'm just trying to be helpful if possible.

    That said, I found a link which seems to suggest that it's appropriate to use GetClientRect to get the size of the drawing area:

    RECT clientRect;
    
    GetClientRect(hWnd,&clientRect);
    

    http://www.toymaker.info/Games/html/gdi.html#winsize

提交回复
热议问题