牵着老婆满街逛

严以律己,宽以待人. 三思而后行.
GMail/GTalk: yanglinbo#google.com;
MSN/Email: tx7do#yahoo.com.cn;
QQ: 3 0 3 3 9 6 9 2 0 .

GDI Objects

FROM:http://msdn.microsoft.com/en-us/library/ms724291(v=vs.85).aspx

GDI objects support only one handle per object. Handles to GDI objects are private to a process. That is, only the process that created the GDI object can use the object handle.

There is a theoretical limit of 65,536 GDI handles per session. However, the maximum number of GDI handles that can be opened per session is usually lower, since it is affected by available memory.

Windows 2000:  There is a limit of 16,384 GDI handles per session.

There is also a default per-process limit of GDI handles. To change this limit, set the following registry value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota

This value can be set to a number between 256 and 65,536.
Windows 2000:  This value can be set to a number between 256 and 16,384.

Managing GDI Objects

The following table lists the GDI objects, along with each object's creator and destroyer functions. The creator functions either create the object and an object handle or simply return the existing object handle. The destroyer functions remove the object from memory, which invalidates the object handle.

GDI object Creator function Destroyer function
Bitmap CreateBitmap, CreateBitmapIndirect, CreateCompatibleBitmap, CreateDIBitmap, CreateDIBSection, CreateDiscardableBitmap DeleteObject
Brush CreateBrushIndirect, CreateDIBPatternBrush, CreateDIBPatternBrushPt, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush DeleteObject
DC CreateDC DeleteDC,ReleaseDC
Enhanced metafile CreateEnhMetaFile DeleteEnhMetaFile
Enhanced-metafile DC CreateEnhMetaFile CloseEnhMetaFile
Font CreateFont, CreateFontIndirect DeleteObject
Memory DC CreateCompatibleDC DeleteDC
Metafile CreateMetaFile DeleteMetaFile
Metafile DC CreateMetaFile CloseMetaFile
Palette CreatePalette DeleteObject
Pen and extended pen CreatePen, CreatePenIndirect, ExtCreatePen DeleteObject
Region CombineRgn, CreateEllipticRgn, CreateEllipticRgnIndirect, CreatePolygonRgn, CreatePolyPolygonRgn, CreateRectRgn, CreateRectRgnIndirect,CreateRoundRectRgn, ExtCreateRegion, PathToRegion DeleteObject

 

 

 

Send comments about this topic to Microsoft

Build date: 2/10/2011

posted on 2011-03-11 01:47 杨粼波 阅读(852) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理