Minigui学习--DC

本文介绍了MiniGUI中关于Device Context (DC)的操作,包括如何通过GetDC和GetClientDC获取DC,以及ReleaseDC来释放DC。讨论了DC的背景颜色、模式、笔颜色、刷颜色、文本颜色等属性的获取与设置方法,并提供了相关函数的用法示例。
摘要由CSDN通过智能技术生成

1.获取与释放DC的相关函数:

函数定义在gdi.h文件中。

MG_EXPORT HDC GUIAPI GetDC (HWND hwnd); //gets a window DC of the specified \a hwnd, and returns  the handle to the DC. MiniGUI will try to return an unused DC from the internal DC pool, rather than allocate a new one from the system heap

 

MG_EXPORT HDC GUIAPI GetClientDC (HWND hwnd);//gets a client DC of the specified \a hwnd, and returns the  handle to the DC. MiniGUI will try to return an unused DC from the internal DC pool, rather than allocate a new one from the system heap

 

MG_EXPORT void GUIAPI ReleaseDC (HDC hdc);//Releases a DC from DC pool

 

注意:GetDC 是获得window的DC,即整个Screen的DC,而GetClientDC是获得客户区域的DC。例如执行如下代码:

    case MSG_MOUSEMOVE:
    {
        int x = LOWORD (lParam);
        int y = HIWORD (lParam);

        

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值