Common and private DC
2006-11-26 01:54
197 查看
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.
相关文章推荐
- Javascript Module pattern template. Shows a class with a constructor and public/private methods/properties. Also shows compatibility with CommonJS(eg Node.JS) and AMD (eg requireJS) as well as in a br
- iWatch报错: Fail to code sign "***" No valid signing identities (i.e. certificate and private key pair
- The difference between the private and public clouds
- 解决Can't find common super class of [android/app/Application] (with 4 known super classes) and [com/m
- C# SharpSsh Private-public a pair key to Upload and Download File
- TIJ学习系列--override final and private method
- 消息 1033,级别 15 The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table
- Methods and systems for sharing common job information
- CVE(common vulnerabilities and exposures) 通用漏洞与后门?
- Private virtual networks for Solaris xVM and Zones with Crossbow
- Some Common Issues that Ruin GPS Measurements and Projects
- #Paper Reading# Private traits and attributes are predictable from digital records of human behavior
- Range Minimum Query and Lowest Common Ancestor
- Multi-processor having shared memory, private cache memories, and invalidate queues having valid bits and flush bits for serializing transactions
- Range Minimum Query and Lowest Common Ancestor
- android多工程应用关系 android dependencies and android private libraries
- [LeetCode OJ]Count and Say && Valid Palindrome && Longest Common Prefix
- [API]common http get and post
- The public key and the private key
- Java reflection: accessing private fields and methods