Alsing.Drawing.GDI.GDISurface.Init C# (CSharp) Method

Init() protected method

protected Init ( int width, int height, IntPtr hdc ) : void
width int
height int
hdc System.IntPtr
return void
        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!!");
        }