GDI对象都必须调用相应的方法进行销毁。如下表
GDI对象
产生方法
销毁方法
位图(HBITMAP)
CreateBitmap,CreateBitmapIndirect,
CreateCompatibleBitmap,CreateDIBitmap,
CreateDIBSection,CreateDiscardableBitmap
DeleteObject
画刷(HBRUSH)
CreateBrushIndirect,CreateDIBPatternBrush,
CreateDIBPatternBrushPt,CreateHatchBrush,
CreatePatternBrush,CreateSolidBrush
设备上下文(HDC)
CreateDC
DeleteDC,ReleaseDC
字体(HFONT)
CreateFont,CreateFontIndirect
内存DC(HDC)
CreateCompatibleDC
DeleteDC
调色板(HPALETTE)
CreatePalette
画笔(HPEN)
CreatePen,CreatePenIndirect
区域(HRGN)
CombineRgn,CreateEllipticRgn,
CreateEllipticRgnIndirect,CreatePolygonRgn,
CreatePolyPolygonRgn,CreateRectRgn,
CreateRectRgnIndirect,CreateRoundRectRgn,
Powered by: C++博客 Copyright © Enic