2

Closed

Print screen bug

description

Hello.
 
I have just installed cropper.
After pressing print screen button i do receive next message (w7x86):
 
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
 
************** Exception Text **************
System.ArgumentException: Parameter is not valid.
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
at System.Drawing.Bitmap..ctor(Int32 width, Int32 height)
at Fusion8.Cropper.Core.NativeMethods.GetDesktopBitmap(Int32 x, Int32 y, Int32 width, Int32 height)
at Fusion8.Cropper.Core.NativeMethods.GetDesktopBitmap(Rectangle rectangle)
at Fusion8.Cropper.Core.NativeMethods.GetDesktopBitmap(IntPtr hWnd, Boolean colorNonFormArea, Color backgroundColor)
at Fusion8.Cropper.Core.ImageCapture.CaptureByHdc(IntPtr hdc, Boolean cropAndColor)
at Fusion8.Cropper.Core.ImageCapture.CaptureDesktop()
at Fusion8.Cropper.MainCropForm.TakeScreenShot(ScreenShotBounds bounds)
at Fusion8.Cropper.MainCropForm.OnHotKeyPress(KeyEventArgs e)
at Fusion8.Cropper.CropForm.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
 
 
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5444 (Win7SP1GDR.050727-5400)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

Cropper
Assembly Version: 1.9.4.89
Win32 Version: 1.9.4.89

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/Cropper.exe

Cropper.Core
Assembly Version: 1.9.4.89
Win32 Version: 1.9.4.89

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/Cropper.Core.DLL

System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

Skybound.VisualStyles
Assembly Version: 2.0.0.0
Win32 Version: 2.1.1.0

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/Skybound.VisualStyles.DLL

System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

Cropper.Extensibility
Assembly Version: 1.9.4.89
Win32 Version: 1.9.4.89

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/Cropper.Extensibility.DLL

Cropper.AnimatedGif
Assembly Version: 1.3.9.0
Win32 Version: 1.3.9

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/plugins/Cropper.AnimatedGif.dll

Cropper.JpgFormat
Assembly Version: 1.1.1.0
Win32 Version: 1.1.1.0

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/plugins/Cropper.JpgFormat.dll

Cropper.PngFormat
Assembly Version: 1.0.1.0
Win32 Version: 1.0.1.0

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/plugins/Cropper.PngFormat.dll

Cropper.SendToEmail
Assembly Version: 1.3.9.0
Win32 Version: 1.3.9

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/plugins/Cropper.SendToEmail.dll

Cropper.SendToImageShack
Assembly Version: 1.3.9.0
Win32 Version: 1.3.9

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/plugins/Cropper.SendToImageShack.dll

Cropper.SendToImgur
Assembly Version: 1.3.9.0
Win32 Version: 1.3.9

CodeBase: file:///C:/Program%20Files/Fusion8Design/Cropper/plugins/Cropper.SendToImgur.dll

System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

gra0xklp
Assembly Version: 1.9.4.89
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

lljnlhtm
Assembly Version: 1.9.4.89
Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)

CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

 
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
 
For example:
 
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
 
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Closed Jul 19, 2013 at 12:26 AM by TerryHughes
If this is still an issue that needs addressed, please create a new issue.

comments

enriquein wrote Aug 19, 2011 at 7:07 PM

Did you choose an output plugin before hitting print screen? I seem to remember that exception being thrown when no outputs are selected.

I'm not in front of a computer that has cropper installed at the moment, but if memory serves right, you can set an output from the small cropper icon in the notification area (area near the clock, bottom right corner by default). Right click the icon, inside the output submenu choose an image format. Try taking the screenshot afterwards.

62316e wrote Aug 19, 2011 at 8:46 PM

I did set the output format bcs by default is BMP?
Double click works good but PrintScreen key is not working.

62316e wrote Aug 19, 2011 at 8:51 PM

The problem is that internal static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect); method returns 0. Just read the stack track i post you before.

62316e wrote Aug 19, 2011 at 8:56 PM

NativeMethods.FindWindow(null, "Program Manager") <- Here the problem!

capture = GetDesktopBitmap(Screen.PrimaryScreen.Bounds); <- better way to get screen size anyway.

enriquein wrote Aug 19, 2011 at 11:12 PM

I'll look into it. This codebase is really old (I believe since .Net 1.1), so that could have been for compatibility or whatever. I agree with you and appreciate that you went through the effort of debugging the issue.

62316e wrote Aug 20, 2011 at 8:56 AM

Its no problem! (Screen.PrimaryScreen supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0 )
U just need to fix some stupid errors and project will be good. (I will spam you about hot keys a bit later)

62316e wrote Aug 20, 2011 at 8:57 AM

The problem i faced with occurred because i dont use exlorer at all.

enriquein wrote Aug 20, 2011 at 11:00 AM

I don't think it's related to using explorer. Its far more likely that you're using a non-english version of Windows. That explains why searching for "Program Manager" returns 0.

I'll work the fix in tonight. However, I don't have commit access to this repository. What I usually do is post a build with the new changes in my github mirror. I'll let you know when it's ready.

62316e wrote Aug 20, 2011 at 12:26 PM

I'm using English version of Windows 7 x86 Ultimate.

Exertion wrote Feb 6, 2012 at 9:18 AM

With gif output plugin it gives me almost the same error:
<pre>See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.ArgumentException: Parameter is not valid. at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap..ctor(Int32 width, Int32 height) at Fusion8.Cropper.Core.NativeMethods.GetDesktopBitmap(Int32 x, Int32 y, Int32 width, Int32 height) at Fusion8.Cropper.Core.NativeMethods.GetDesktopBitmap(Rectangle rectangle) at Fusion8.Cropper.Core.ImageCapture.Fusion8.Cropper.Extensibility.IPersistableOutput.FetchCapture(ImageHandler imageHandler) at Cropper.AnimatedGif.Plugin._recordTimer_Tick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) </pre>

wrote Feb 6, 2012 at 9:21 AM

62316e wrote Feb 6, 2012 at 10:08 AM

Are kidding me?
Can you just kill explorer.exe and press print screen?
You fixing crutical bug for half year already. I'm using clip2net, faster, free, no stupid bugs.

wrote Feb 27, 2012 at 11:34 PM

Exertion wrote Jan 23, 2013 at 10:18 AM

I wish somebody take over this project. Ahh.. well, I did the fix for myself:

imagecapture.cs:
    void IPersistableOutput.FetchCapture(ImageHandler imageHandler)
    {
        if (captureRectangle.Width == 0 || captureRectangle.Height == 0) return;
        using (Image image = NativeMethods.GetDesktopBitmap(captureRectangle))
            imageHandler(image);
    }
maincropform.cs:
    protected override void OnHotKeyPress(KeyEventArgs e)
    {
        if (e.KeyCode == Keys.PrintScreen)
        {
            if (e.Alt && e.Control)
                //TakeScreenShot(ScreenShotBounds.FullScreen);
            else if (e.Shift)
                TakeScreenShot(ScreenShotBounds.Window);
            else if (e.Alt)
                TakeScreenShot(ScreenShotBounds.ActiveForm);
            else
                TakeScreenShot(ScreenShotBounds.Rectangle);
        }
        else if (e.KeyCode == Keys.F8)
            CycleFormVisibility(false);
        base.OnHotKeyPress(e);
    }

enriquein wrote Jan 23, 2013 at 11:50 PM

I feel the same way. It's a shame that Brian dissappeared off the face of the Earth and now Terry is too busy to even look at submitted patches.

I would love it if someone could get ownership of the project so we could move this on to github, where all the real open source collaboration happens.

Hell, I'd even be willing to take on the project if no one else wants it.

wrote Feb 22, 2013 at 12:26 AM

wrote May 16, 2013 at 11:38 AM

wrote May 16, 2013 at 11:38 AM

wrote Jun 14, 2013 at 7:31 AM

wrote Jul 19, 2013 at 12:26 AM