设备上限功能不返回摘录数据 [英] device caps function dosnot return the exct data

查看:84
本文介绍了设备上限功能不返回摘录数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GetDeviceCaps(HORZRES);

GetDeviceCaps(VERTRES);
不返回设备上下文的确切大小,而是返回整个屏幕的分辨率
如何仅获取可以在其中绘制

GetDeviceCaps(HORZRES);
and
GetDeviceCaps(VERTRES);
doesnot return the exact size of the device context it returns the resolution of my whole screen
how to get only the area of device context where we can draw

推荐答案

的设备上下文区域.通常,在OnPaint()处理程序中,您将调用BeginPaint().这将使用绘画信息(包括rcPaint RECT)填充PAINTSTRUCT结构.

另一种非常常见的方法是简单地调用GetClientRect(),它返回控件整个客户区的RECT.
Usually in an OnPaint() handler you will call BeginPaint(). This fills the PAINTSTRUCT structure with painting info, including the rcPaint RECT.

Another very common way is to simply call GetClientRect(), which returns the RECT for the entire client area of a control.


这篇关于设备上限功能不返回摘录数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆