コード例 #1
0
            public BufferedPaintHandle(IWin32Window wnd, SafeDCHandle hdc, Rectangle targetRectangle,
                                       BufferedPaintAnimationParams?animationParams = null,
                                       BufferedPaintParams paintParams = null, BufferedPaintBufferFormat fmt = BufferedPaintBufferFormat.CompatibleBitmap)
                : base(IntPtr.Zero, true)
            {
                RECT   rc = targetRectangle;
                var    ap = animationParams ?? BufferedPaintAnimationParams.Empty;
                IntPtr hdcFrom, hdcTo;
                var    hbp = BeginBufferedAnimation(new HandleRef(wnd, wnd.Handle), hdc, ref rc, fmt, paintParams, ref ap, out hdcFrom,
                                                    out hdcTo);

                if (hbp == IntPtr.Zero)
                {
                    throw new Win32Exception();
                }
                if (hdcFrom != IntPtr.Zero)
                {
                    SourceGraphics = Graphics.FromHdc(hdcFrom);
                }
                if (hdcTo != IntPtr.Zero)
                {
                    Graphics = Graphics.FromHdc(hdcTo);
                }
                SetHandle(hbp);
                ani = true;
            }
コード例 #2
0
            public BufferedPaintHandle(SafeDCHandle hdc, Rectangle targetRectangle, BufferedPaintParams paintParams = null,
                                       BufferedPaintBufferFormat fmt = BufferedPaintBufferFormat.CompatibleBitmap) : base(IntPtr.Zero, true)
            {
                RECT target = targetRectangle;
                var  hbp    = BeginBufferedPaint(hdc, ref target, fmt, paintParams, out var phdc);

                if (hbp == IntPtr.Zero)
                {
                    throw new Win32Exception();
                }
                if (phdc != IntPtr.Zero)
                {
                    Graphics = Graphics.FromHdc(phdc);
                }
                SetHandle(hbp);
            }
コード例 #3
0
 public static extern IntPtr BeginBufferedPaint(SafeDCHandle hdcTarget, [In] ref RECT prcTarget, BufferedPaintBufferFormat dwFormat, [In] BufferedPaintParams pPaintParams, out IntPtr phdc);
コード例 #4
0
 public static extern IntPtr BeginBufferedAnimation(HandleRef hwnd, SafeDCHandle hdcTarget, [In] ref RECT rcTarget, BufferedPaintBufferFormat dwFormat,
                                                    [In] BufferedPaintParams pPaintParams, [In] ref BufferedPaintAnimationParams pAnimationParams, out IntPtr phdcFrom, out IntPtr phdcTo);