Common and private DC
来源:互联网 发布:mac获取文件夹权限 编辑:程序博客网 时间:2024/05/14 09:09
Common and private DC
The two primary types of display device contexts are common and private.
(The third supported type, class, is obsolete.) When retrieving the DC handle,
the DC will be private if the window class was registered with the CS_OWNDC class style,
otherwise it will be common.
A common DC handle is retrieved when GetDC (or BeginPaint) is called. Every time it’s retrieved,
it references a new DC initialized with a default set of attributes.
Thus to keep memory usage low, the common DC should be released with ReleaseDC (or EndPaint).
The common DC is generally used as a temporary DC,
acquired and released by each message handler needing a DC.
A private DC is created when a window is created. Its handle can be retrieved with the GetDC (or BeginPaint) function,
and it’s not necessary to call ReleaseDC. Unlike the common DC,
it is not reinitialized on retrieval.
As a result, you avoid the need to reset all your drawing tools and modes with every message requiring graphics.
The two primary types of display device contexts are common and private.
(The third supported type, class, is obsolete.) When retrieving the DC handle,
the DC will be private if the window class was registered with the CS_OWNDC class style,
otherwise it will be common.
A common DC handle is retrieved when GetDC (or BeginPaint) is called. Every time it’s retrieved,
it references a new DC initialized with a default set of attributes.
Thus to keep memory usage low, the common DC should be released with ReleaseDC (or EndPaint).
The common DC is generally used as a temporary DC,
acquired and released by each message handler needing a DC.
A private DC is created when a window is created. Its handle can be retrieved with the GetDC (or BeginPaint) function,
and it’s not necessary to call ReleaseDC. Unlike the common DC,
it is not reinitialized on retrieval.
As a result, you avoid the need to reset all your drawing tools and modes with every message requiring graphics.
- Common and private DC
- [Python]private and public
- private method and category
- public,private and protected
- hWnd, DC, and the virtual system coordinates
- HWND and HDC 以及 DC 释放问题
- DC
- DC
- DC
- DC
- DC
- DC
- dc
- DC
- dc
- DC
- DC
- DC
- Writing a bitmap to a BMP file
- XHTML各种标签的运用
- Copying a bitmap to clipboard
- CMetaFile class
- hWnd, DC, and the virtual system coordinates
- Common and private DC
- Image类的序列化
- 取得当前会话中的Identity值 -- SCOPE_IDENTITY()
- 制作一款简洁实用的图片浏览器
- 读取JPEG和GIF图像的简单方法
- 添加系统图象列表到列表控件
- 关于位图行程编码格式压缩
- VC怎样把一副自己画的图存成BMP格式
- 如何用VC抓取屏幕图象并压缩?