GDI对象都必须调用相应的方法进行销毁

GDI对象都必须调用相应的方法进行销毁

GDI对象都必须调用相应的方法进行销毁。如下表

GDI对象

产生方法

销毁方法

位图(HBITMAP)

CreateBitmap,CreateBitmapIndirect,

CreateCompatibleBitmap,CreateDIBitmap,

CreateDIBSection,CreateDiscardableBitmap

DeleteObject

画刷(HBRUSH)

CreateBrushIndirect,CreateDIBPatternBrush,

CreateDIBPatternBrushPt,CreateHatchBrush,

CreatePatternBrush,CreateSolidBrush

DeleteObject

设备上下文(HDC)

CreateDC

DeleteDC,ReleaseDC

字体(HFONT)

CreateFont,CreateFontIndirect

DeleteObject

内存DC(HDC)

CreateCompatibleDC

DeleteDC

调色板(HPALETTE)

CreatePalette

DeleteObject

画笔(HPEN)

CreatePen,CreatePenIndirect

DeleteObject

区域(HRGN)

CombineRgn,CreateEllipticRgn,

CreateEllipticRgnIndirect,CreatePolygonRgn,

CreatePolyPolygonRgn,CreateRectRgn,

CreateRectRgnIndirect,CreateRoundRectRgn,

DeleteObject


你可能感兴趣的:(GDI对象都必须调用相应的方法进行销毁)