예제 #1
0
        public void CopyFromBitmap(D2D1Point2U destPoint, D2D1Bitmap srcBitmap)
        {
            if (srcBitmap == null)
            {
                throw new ArgumentNullException("srcBitmap");
            }

            GCHandle destPointHandle = GCHandle.Alloc(destPoint, GCHandleType.Pinned);

            try
            {
                this.bitmap.CopyFromBitmap(destPointHandle.AddrOfPinnedObject(), srcBitmap.bitmap, IntPtr.Zero);
            }
            finally
            {
                destPointHandle.Free();
            }
        }
예제 #2
0
        public void CopyFromRenderTarget(D2D1Point2U destPoint, D2D1RenderTarget renderTarget)
        {
            if (renderTarget == null)
            {
                throw new ArgumentNullException("renderTarget");
            }

            GCHandle destPointHandle = GCHandle.Alloc(destPoint, GCHandleType.Pinned);

            try
            {
                this.bitmap.CopyFromRenderTarget(destPointHandle.AddrOfPinnedObject(), renderTarget.GetHandle <ID2D1RenderTarget>(), IntPtr.Zero);
            }
            finally
            {
                destPointHandle.Free();
            }
        }