public virtual Bitmap Capture(IntPtr handle)
        {
            NativeMethods.BringWindowToTop(handle);
            CaptureHandleDelegateHandler handler = new CaptureHandleDelegateHandler(this.CaptureHandle);
            IAsyncResult result = handler.BeginInvoke(handle, null, null);

            return(handler.EndInvoke(result));
        }
        public virtual Bitmap Capture(IntPtr handle)
        {
            WindowsApi.BringWindowToTop(handle);
            CaptureHandleDelegateHandler dlg = this.CaptureHandle;
            IAsyncResult result = dlg.BeginInvoke(handle, null, null);

            return(dlg.EndInvoke(result));
        }
Exemple #3
0
        /// <summary>
        /// Execute the capturing of a window specified by it's windows handle.
        /// The image which has been captured is saved to the 'images[0]' attribute in this class.
        /// This method uses old API calls !!!!!!!
        /// </summary>
        /// <param name="handle">The handle of the window to capture</param>
        /// <returns>The image which has been captured.</returns>
        public virtual Bitmap Capture(IntPtr handle)
        {
            //	Move the window to capture to the top of the Z order.
            NativeMethods.BringWindowToTop(handle);

            CaptureHandleDelegateHandler dlg = new CaptureHandleDelegateHandler(CaptureHandle);

            //	Do an asynchronous call of the capturing method, this is necessary to allow the captured
            //	window to come up in front of the Z-order of the displayed screens.
            IAsyncResult result = dlg.BeginInvoke(handle, null, null);

            return(dlg.EndInvoke(result));
        }
Exemple #4
0
        public virtual Bitmap Capture(IntPtr handle)
        {
            if (Kohl.Framework.Info.MachineInfo.IsUnixOrMac)
            {
                Log.Fatal("Screen caputure is only supported on Windows at the moment.");
                return(new Bitmap(0, 0));
            }

            WindowsApi.BringWindowToTop(handle);
            CaptureHandleDelegateHandler dlg = this.CaptureHandle;
            IAsyncResult result = dlg.BeginInvoke(handle, null, null);

            return(dlg.EndInvoke(result));
        }
Exemple #5
0
        /// <summary>
        /// Execute the capturing of a window specified by it's windows handle.
        /// The image which has been captured is saved to the 'images[0]' attribute in this class.
        /// This method uses old API calls !!!!!!!
        /// </summary>
        /// <param name="handle">The handle of the window to capture</param>
        /// <returns>The image which has been captured.</returns>
        public virtual Bitmap Capture( IntPtr handle )
        {
            //	Move the window to capture to the top of the Z order.
            NativeMethods.BringWindowToTop( handle );

            CaptureHandleDelegateHandler dlg = new CaptureHandleDelegateHandler( CaptureHandle );

            //	Do an asynchronous call of the capturing method, this is necessary to allow the captured
            //	window to come up in front of the Z-order of the displayed screens.
            IAsyncResult result = dlg.BeginInvoke( handle, null, null );
            return dlg.EndInvoke( result );
        }
 public virtual Bitmap Capture( IntPtr handle )
 {
     NativeMethods.BringWindowToTop( handle );
     CaptureHandleDelegateHandler dlg = new CaptureHandleDelegateHandler( CaptureHandle );
     IAsyncResult result = dlg.BeginInvoke( handle, null, null );
     return dlg.EndInvoke( result );
 }