Win32.NativeWin32MemoryDc.SetBackTransparent C# (CSharp) Method

SetBackTransparent() public method

public SetBackTransparent ( bool value ) : void
value bool
return void
        public void SetBackTransparent(bool value)
        {
            //public const int _SetBkMode_TRANSPARENT = 1;
            //public const int _SetBkMode_OPAQUE = 2;
            MyWin32.SetBkMode(memHdc, value ? 1 : 2);
        }
        public enum PatBltColor

Usage Example

        void CreateGraphicsFromNativeHdc(int width, int height)
        {
            win32MemDc = new NativeWin32MemoryDc(width, height, true);
            win32MemDc.PatBlt(NativeWin32MemoryDc.PatBltColor.White);
            win32MemDc.SetBackTransparent(true);
            win32MemDc.SetClipRect(0, 0, width, height);

            this.originalHdc = win32MemDc.DC;
            //--------------
            //set default font and default text color
            this.CurrentFont = new RequestFont("tahoma", 14);
            this.CurrentTextColor = Color.Black;
            //--------------

        }