コード例 #1
0
ファイル: CpuBlitAppModule.cs プロジェクト: BiDuc/PixelFarm
 public void Dispose()
 {
     if (_nativeWin32DC != null)
     {
         _nativeWin32DC.Dispose();
         _nativeWin32DC = null;
     }
 }
コード例 #2
0
        public void Dispose()
        {
            //TODO: review here
            _defautInitFont.Dispose();
            _defautInitFont = null;

            _hfont = IntPtr.Zero;
            _memdc.Dispose();
        }
コード例 #3
0
 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
         _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();
     }
 }
コード例 #4
0
ファイル: SkiaCanvasViewport.cs プロジェクト: BiDuc/PixelFarm
 protected override void OnClosing()
 {
     memdc.Dispose();
     base.OnClosing();
 }