예제 #1
0
 public void Dispose()
 {
     //TODO: review here
     Win32.MyWin32.DeleteObject(hfont);
     hfont = IntPtr.Zero;
     memdc.Dispose();
 }
 public void Dispose()
 {
     if (nativeWin32Dc != null)
     {
         nativeWin32Dc.Dispose();
         nativeWin32Dc = null;
     }
 }
        public void Dispose()
        {
            //TODO: review here
            _defautInitFont.Dispose();
            _defautInitFont = null;

            hfont = IntPtr.Zero;
            memdc.Dispose();
        }
        public override void CopyOutputPixelBuffer(int x, int y, int w, int h, IntPtr outputBuffer)
        {
            //1. This version support on Win32 only
            //2. this is an example, to draw directly into the memDC, not need to create control
            //3. x and y set to 0
            //4. w and h must be the width and height of the viewport


            unsafe
            {
                //create new memdc
                Win32.NativeWin32MemoryDc memDc = new Win32.NativeWin32MemoryDc(w, h);
                memDc.PatBlt(Win32.NativeWin32MemoryDc.PatBltColor.White);
                //TODO: check if we need to set init font/brush/pen for the new DC or not
                gdiPlusViewport.FullMode = true;
                //pain to the destination dc
                this.gdiPlusViewport.PaintMe(memDc.DC);
                IntPtr outputBits = memDc.PPVBits;
                //Win32.MyWin32.memcpy((byte*)outputBuffer, (byte*)memDc.PPVBits, w * 4 * h);
                memDc.CopyPixelBitsToOutput((byte *)outputBuffer);
                memDc.Dispose();
            }
        }
예제 #5
0
 protected override void OnClosing()
 {
     memdc.Dispose();
     base.OnClosing();
 }