protected void Init(int width, int height, IntPtr hdc)
{
mWidth = width;
mHeight = height;
mhDC = NativeMethods.CreateCompatibleDC(hdc);
mhBMP = NativeMethods.CreateCompatibleBitmap(hdc, width, height);
IntPtr ret = NativeMethods.SelectObject(mhDC, mhBMP);
_OldBmp = ret;
if (mhDC == (IntPtr)0)
throw new OutOfMemoryException("hDC creation FAILED!!");
if (mhDC == (IntPtr) 0)
throw new OutOfMemoryException("hBMP creation FAILED!!");
}