1) Doesn't work properly with dual monitors - only captures primary monitor, same with rectangle selection.
2) There are two shared member warnings: lines 143, 145
3) You should delete the bin/obj folders...
1) Doesn't work properly with dual monitors - only captures primary monitor, same with rectangle selection.
2) There are two shared member warnings: lines 143, 145
3) You should delete the bin/obj folders...
Other then that, it works good.
1/ i can't change that. no way for me to test it.
2/ i don't get a warning on those lines
3/ i deleted the binaries
#Region " notifyicon"
Private Sub ni1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ni1.MouseDoubleClick
Me.Show()
If e.Button = MouseButtons.Left And Me.WindowState = FormWindowState.Minimized Then
Me.WindowState = FormWindowState.Normal
ElseIf e.Button = MouseButtons.Left And Me.WindowState = FormWindowState.Normal Then
Me.Activate()
End If
End Sub
#End Region
Re: screen capture (New version: (VB2008) dual screen capture)
heres an updated version. i've upgraded it to VB2008, + added support for dual monitors.
it now captures:
1/ (either) whole screen, depending where the cursor is.
2/ the active window, whichever screen its displayed on.
3/ a selected rectangle from either screen again depending where the cursor is.
Originally Posted by austinjf785
It won't work with 2010 Express
Originally Posted by gep13
I didn't think that Visual Studio 2010 Express had been released.
I am running the Beta 1 of Visual Studio 2010, but I didn't think there was a Beta of the Express Editions, if so, where is the download, would be interesting to have a look!
I like your project, especially how you've made the rectangle selection work.
However, to be honest the selection is drawn quite slowly. It might be my computer that is the problem, but invalidating the form every time the cursor moves doesn't really give a decent speed to an application.
Another tip, you should save screenshots in .png format, not in .jpg. The quality of .jpg is very bad for screenshots whereas there's no quality lose in the .png format.
Other than that it's been very helpful for me. Thanks.
This is an open forum, and I am sure .paul. wouldn't find if you took his code and submitted your own changes/improvements.
Gary
no i probably wouldn't find + i wouldn't mind either. if you can improve it, go for it.
Originally Posted by pimvdb
I like your project, especially how you've made the rectangle selection work.
However, to be honest the selection is drawn quite slowly. It might be my computer that is the problem, but invalidating the form every time the cursor moves doesn't really give a decent speed to an application.
Another tip, you should save screenshots in .png format, not in .jpg. The quality of .jpg is very bad for screenshots whereas there's no quality lose in the .png format.
Other than that it's been very helpful for me. Thanks.
jpeg provides good enough quality for me. the invalidating is necessary to redraw the selection rectangle, + it works ok on my pc, but maybe not on an older or less powerful pc
Actually I already tried to enhance the speed, but with no luck. Removing the invalidating part even didn't matter, it was painted well without but didn't speed up the whole. My computer sure isn't the best out there but I'll keep trying
doesn't work, i get Object reference not set to an instance of an object.
at this part.
Code:
regShell = regKey.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", False)
If LCase(regShell.GetValue("screen capture").ToString) = Application.ExecutablePath.ToLower Then <--- this line
RunToolStripMenuItem.Checked = True
End If
Remember to rate posts with the button on the left()
i downloaded the project did nothing tryed to debug it and got error of what i showed you, so if it was set up in the source then yes i did have it set up.
Remember to rate posts with the button on the left()
I think this might be a slight glitch with the problem, that wasn't highlighted in initial testing, as that registry key would have already been in place.
Try changing that section of the code to something like the following:
Code:
regShell = regKey.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", False)
If Not regShell.GetValue("screen capture") Is Nothing Then
If LCase(regShell.GetValue("screen capture").ToString) Is Application.ExecutablePath.ToLower Then
RunToolStripMenuItem.Checked = True
End If
End If
Thanks for the source, its awesome!
But I need to know one thing.
If you click prnt screen when you have capture selected rectangle on, you have to click prnt screen again to actually save the image.
Is there a way to not have to press prnt screen again, so it just saves it whenever you drawn your first rectangle?
Also when im building the project and I try to run the application it gives me this error, whats wrong?
Thanks,
Jordy
Last edited by jordy12345; Apr 3rd, 2013 at 07:15 AM.
Thanks for the source, its awesome!
But I need to know one thing.
If you click prnt screen when you have capture selected rectangle on, you have to click prnt screen again to actually save the image.
Is there a way to not have to press prnt screen again, so it just saves it whenever you drawn your first rectangle?
Also when im building the project and I try to run the application it gives me this error, whats wrong?
Thanks,
Jordy
you could use the mouseup event instead of a 2nd PRTSCR
as for the error msg, can you translate that into english?
If you dont want to do that, here is the code translated in google translator.
Code:
There is an unhandled exception occurred in the application. If you click Continue, this error is ignored and the application. If you click Quit, the application is immediately closed.
There is a general error occurred in GDI +.
Code:
See the end of this message for details on invoking
JIT (Just In Time) debugging instead of this dialog box.
************** Exception Text **************
System.Runtime.InteropServices.ExternalException (0x80004005): There is a general error occurred in GDI +.
***at System.Drawing.Image.Save (String filename, Image Codec encoder, Encoder Parameters encoderParams)
***screen_capture.Form1.WndProc (Message & m)
***at System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
************** Loaded Assemblies **************
mscorlib
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
****Codebase: file :/ / / C :/ Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
screen capture
****Assembly Version: 1.0.0.0
****Win32 version: 1.0.0.0
****Codebase:
----------------------------------------
Microsoft.VisualBasic
****Assembly Version: 10.0.0.0
****Win32 version: 11.0.50709.17929 built by FX45RTMREL
****Codebase:
----------------------------------------
System
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
****Codebase: file :/ / / C :/ WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
****Codebase:
----------------------------------------
System.Windows.Forms
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.18036 built by: FX45RTMGDR
****Codebase:
----------------------------------------
System.Drawing
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.18021 built by: FX45RTMGDR
****Codebase:
----------------------------------------
System.Runtime.Remoting
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
****Codebase:
----------------------------------------
System.Configuration
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
****Codebase:
----------------------------------------
System.Xml
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.18034 built by: FX45RTMGDR
****Codebase:
----------------------------------------
Accessibility
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
****Codebase:
----------------------------------------
System.Drawing.resources
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.1 built by: RTMRel
****Codebase:
----------------------------------------
System.Windows.Forms.resources
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.1 built by: RTMRel
****Codebase:
----------------------------------------
mscorlib.resources
****Assembly Version: 4.0.0.0
****Win32 Version: 4.0.30319.1 (RTMRel.030319 0100)
****Codebase:
----------------------------------------
************** JIT Debugging **************
If you want to enable JIT debugging in the configuration file for this
application or computer (machine.config) the value
jitDebugging are set in the system.windows.forms section.
The application must also be compiled with debugging
was enabled.
For example:
<configuration>
****<system.windows.forms jitDebugging="true" Deal
</ Configuration>
When JIT debugging is enabled, any unhandled exception
sent to the JIT debugger registered on the computer
and are not handled by this dialog.
@jordy
i think you'll find the error is due to filesystem security not allowing file saving in that location.
try changing the save to folder...
Thanks for your reply, the problem was that it couldn't save the picture because there was no images directory in the folder.
I thought that it would create the folder automaticly, thanks.