Capture command line options

Ideas for improvements and requests for new features in XnView Classic

Moderators: XnTriq, xnview

User avatar
Dreamer
XnThusiast
Posts: 4605
Joined: Sun Jul 25, 2004 9:08 pm
Location: Slovakia

Capture command line options

Post by Dreamer » Fri Sep 08, 2006 10:51 pm

I suggest the following capture command line options:

-capture window (to capture active window)
-capture desktop (to capture desktop) partially working, more below

Options from Capture setup should be used for these options (include cursor, open in xnview, dir, format).

Advanced options:

-capture window <cursor> <path> <name> <format> <quality>
-capture desktop <cursor> <path> <name> <format> <quality>


E.g.:

-capture window cursor D:\Pictures\Capture_yyyymmdd_hhnnss PNG
-capture desktop D:\Pictures\Capture_yyyymmdd_hhnnss JPG 90

Then it would be possible to create a desktop shortcut and assign a keyboard shortcut and use it to make a snapshot anytime and immediately. It would be even easier with the HotkeyP.

Description of these options:

1. Open xnview, minimized, or hidden-
2. Make a snapshot
3A. Save

3B. Open image in xnview
4A. Exit xnview
4B. None

There is one -capture option, but it's very limited, these actions are working correctly, these doesn't - and it's possible to capture desktop only.

Currently it's quite difficult, especially to make a single snapshot.
Last edited by Dreamer on Sat Jul 21, 2007 10:17 pm, edited 1 time in total.
Dreamer

User avatar
helmut
Posts: 8153
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Post by helmut » Sat Jul 21, 2007 6:48 am

The command line options described above are a good idea. But command line options are for more sophisticated users and I guess that people prefer a hotkey to a short cut. Clicking on a shortcut might even change the screen's content and XnView might capture something you don't want.

So I think that the command line options might be a good add-on but the (main) way to go is the hotkey for capturing.

User avatar
Dreamer
XnThusiast
Posts: 4605
Joined: Sun Jul 25, 2004 9:08 pm
Location: Slovakia

Post by Dreamer » Sat Jul 21, 2007 10:01 pm

helmut wrote:The command line options described above are a good idea. But command line options are for more sophisticated users and I guess that people prefer a hotkey to a short cut. Clicking on a shortcut might even change the screen's content and XnView might capture something you don't want.
Hotkey is better if xnview is running, but in this case it's not running, so it should be a shortcut, since it would be a global shortcut, but this shortcut, or hotkey would be customizable. Hope you know what I'm talking about. When you create a desktom shortcut, you can assign a hotkey/shortcut in properties > Shortcut key.

Advantage of this solution is, that you need to press just one hotkey / shortcut to make a snapshot (of desktop, or active window, therefore xnview must start minimized/inactive, or hidden).

I'm already using such a solution in HotkeyP and it works with any hotkey/shorctut, but just BMP format is available here.
helmut wrote:So I think that the command line options might be a good add-on but the (main) way to go is the hotkey for capturing.
I agree, but - perhaps this way is (much) easier to implement and there are also several advantages of this solution - create desktop/active window snapshot:

- anytime (no need to run the program first)
- immediately
- by a single custom global hotkey/keyboard shortcut

- also it would be possible to create two different hotkeys/shortcuts for desktop and active window snapshot - and also for the specific options (format, quality...)

There is also one disadvantage of the other way - If the xnview would start minimized in tray, it would be useful for capture, but if a user would like to start xnview normally, not minimized? In this way the command line options are practically necessary, otherwise the change in options would be needed for users who wants to start xnview sometime normally, sometime minimized.

As I said, -capture command line option is already available, but only to capture desktop and then xnview is opened in browser (or by option), it should be opened in viewer with the actual image opened instead IMO, or closed - in some cases, as suggested. Perhaps it's not a big change and then just another command line option might be added (to capture active window), the other "advanced options" might be added later.

I have tested the -capture command line option now and the actual - active window seems to be retained, it's active at the snapshot, so the new command line option to capture active window should work good - if it would be implemented - in current way.

Edit: The first post has been edited.
Dreamer

User avatar
helmut
Posts: 8153
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Post by helmut » Sun Jul 22, 2007 8:35 am

Thank you, Dreamer, for your explanations.
Dreamer wrote:
helmut wrote:The command line options described above are a good idea. But command line options are for more sophisticated users and I guess that people prefer a hotkey to a short cut. Clicking on a shortcut might even change the screen's content and XnView might capture something you don't want.
Hotkey is better if xnview is running, but in this case it's not running, so it should be a shortcut, since it would be a global shortcut, but this shortcut, or hotkey would be customizable. Hope you know what I'm talking about. When you create a desktom shortcut, you can assign a hotkey/shortcut in properties > Shortcut key.
Yes, I know those global shortcuts. I use them for opening Word and the Web Browser.
Dreamer wrote:Advantage of this solution is, that you need to press just one hotkey / shortcut to make a snapshot (of desktop, or active window, therefore xnview must start minimized/inactive, or hidden).
...
As written before, command line options are very flexible but are an option for more experienced users, only. If possible features in XnView should be obvious and *very* simple to use. For example I guess that there are many (most?) users who haven't made the basic integration steps [url=http://newsgroup.xnview.com/viewtopic.php?t=4043]Browse with XnView] or associated file types with XnView because they just don't know. They will never experience the full usability of XnView.
Dreamer wrote:- also it would be possible to create two different hotkeys/shortcuts for desktop and active window snapshot - and also for the specific options (format, quality...)
That's true. But if you create shortcuts regularly, you wouldn't use XnView but a real screenshot tool like MWSnap, for example.
Dreamer wrote:There is also one disadvantage of the other way - If the xnview would start minimized in tray, it would be useful for capture, but if a user would like to start xnview normally, not minimized?
In this way the command line options are practically necessary, otherwise the change in options would be needed for users who wants to start xnview sometime normally, sometime minimized.
Right, that's an issue, but it can be handled: E.g. if XnView is started for a second time, XnView could simply restore window size from system tray. And XnView could open up whenever it is started with a command line (e.g. the name of an image). Just some ideas, I'm sure there is a simple solution.

Please note that I'm not arguing against command line options, I just want to make clear that whenever possible very simple solutions should be found. Currently I think a hotkey is the way to go. Best would be implementing both a good hotkey solution and the command line options ;-)

Edit: Just realized that this was my 4000th post. :-) I have less time for the forum so the 5000 will take a while...

User avatar
Dreamer
XnThusiast
Posts: 4605
Joined: Sun Jul 25, 2004 9:08 pm
Location: Slovakia

Post by Dreamer » Sun Jul 22, 2007 4:13 pm

helmut wrote:
Dreamer wrote:- also it would be possible to create two different hotkeys/shortcuts for desktop and active window snapshot - and also for the specific options (format, quality...)
That's true. But if you create shortcuts regularly, you wouldn't use XnView but a real screenshot tool like MWSnap, for example.
That's it, I need to create screenshots from time to time, sometimes just one, sometimes more. Current xnview behavior is not good for me, but too complex capture tools either, I don't want any "useless" application running in tray. Therefore xnview (and HotkeyP with custom shortcuts) seems to be the best for me.
helmut wrote:Please note that I'm not arguing against command line options, I just want to make clear that whenever possible very simple solutions should be found. Currently I think a hotkey is the way to go. Best would be implementing both a good hotkey solution and the command line options ;-)
I understand, but perhaps this might be really very easy to implement - the first part, since 'capture desktop' is already working (quite good), 'capture active window' would be enough at least like that for now - this might be easy to implement, since it would be the same as 'capture desktop', just one option would be different.

...But it's a question for Pierre.
helmut wrote:Edit: Just realized that this was my 4000th post. :-) I have less time for the forum so the 5000 will take a while...
Congratulations! I see now, I'm also near to 3000. :)
Dreamer

User avatar
xnview
Author of XnView
Posts: 31362
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Mon Jul 23, 2007 7:59 am

Dreamer wrote: ...But it's a question for Pierre.
So you would like to have -capture window /desktop parameter, right?
Pierre.

User avatar
Dreamer
XnThusiast
Posts: 4605
Joined: Sun Jul 25, 2004 9:08 pm
Location: Slovakia

Post by Dreamer » Tue Jul 24, 2007 12:22 am

Yes, also option to open this image in viewer, or exit xnview after capture, if possible, currently xnview is opened in browser (probably due to startup option).

The other advanced options are not so important. So could you implement at least those basic please?
Dreamer

User avatar
oops66
XnThusiast
Posts: 1999
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Post by oops66 » Tue Jul 24, 2007 4:19 am

For screen capture, maybe an other soft is more appropriate no ?

Try :
Gadwin PrintScreen 4.2 freeware
For Windows® 95, 98, Me, NT 4.0, 2000, 2003, XP and Vista
http://www.gadwin.com/download/

Command Line Arguments
Gadwin PrintScreen accepts these command line arguments on the Windows Run… command line:

/justnow
- Causes Gadwin PrintScreen to do a capture using current settings and close when finished or canceled
/exit
- Close the running instance of PrintScreen and exit
/notaskbar
- Starts Gadwin PrintScreen with the system tray icon disabled
/config=file
- Use configuration file 'file'
/nosplash
- This setting instructs Gadwin PrintScreen not to show a splash screen as it launches
/quiet
- Suppress all informational messages including warnings and errors
/hotkey='key'
- The hot key to start capturing. See also Possible key combinations
/initdelay='delay'
-Define delay in seconds before capture. You can set a delay period so you can set up elements such as menu lists or layouts before completing the capture
/hideicon='yes|no'
- Hide icon when capture
/notifyend='yes|no'
- Displays dialog box notifying you about end of capturing
/showmsg='yes|no'
- This setting instructs Gadwin PrintScreen to show notification messages
/preview='yes|no'
- Displays Capture Preview Window to see the images you capture before finishing output
/cptarea='0|1|2|3'
- Captured area:
0 - select this option to capture all of a user selected window;
1 - select this option to capture the client area of a user selected window;
2 - the full screen is used as source for capturing;
3 - select this option to capture a rectangular region of the screen you select;
/cursor='yes|no'
- Capture the mouse pointer
/clipboard
- Copy the captured image into clipboard
/email
- Send the captured image through electronic mail
/print
- Print the captured image
/askfname='yes|no'
- Ask for the file name after capturing

User avatar
Dreamer
XnThusiast
Posts: 4605
Joined: Sun Jul 25, 2004 9:08 pm
Location: Slovakia

Post by Dreamer » Tue Jul 24, 2007 5:11 pm

Thanks, but I said I don't want another soft. XnView has such a feature already, just few minor changes are needed.

I'd like to use as few programs as possible, xnview is great, also, for example, HokteyP can do the same as TENS of other programs / tools and more - the size is just 184kB - this is the way I want to go.
Dreamer

User avatar
oops66
XnThusiast
Posts: 1999
Joined: Tue Jul 17, 2007 1:17 am
Location: France

Post by oops66 » Tue Jul 24, 2007 5:40 pm

In this case OK.

User avatar
helmut
Posts: 8153
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Post by helmut » Tue Jul 24, 2007 8:26 pm

Just to make sure:
If more command line options are implemented, the error handling when passing invalid command should be verbose and clear. (Currently, the messages in nconvert are not very clear and it's hard to say what went wrong.)

User avatar
xnview
Author of XnView
Posts: 31362
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Fri Jul 27, 2007 9:57 am

Dreamer wrote:Yes, also option to open this image in viewer, or exit xnview after capture, if possible, .
So something like:
-capture=desktop
-capture=window
-capture=window,"c:\temp\test.jpg" (format used from capture dialog)
?
currently xnview is opened in browser (probably due to startup option)
When you use -capture, the browser is opened???? I can't reproduce...
Pierre.

User avatar
Dreamer
XnThusiast
Posts: 4605
Joined: Sun Jul 25, 2004 9:08 pm
Location: Slovakia

Post by Dreamer » Fri Jul 27, 2007 11:24 pm

xnview wrote:
Dreamer wrote:Yes, also option to open this image in viewer, or exit xnview after capture, if possible, .
So something like:
-capture=desktop
-capture=window
-capture=window,"c:\temp\test.jpg" (format used from capture dialog)
?
Yes, please, but how it would work? Would be possible to capture, save and exit? Perhaps: open if no path - and save&exit if there is a path?

Ability to make multiple capture is also important, so perhaps such a format should be used:

"c:\temp\capture###.jpg" (### would be a number - 001, 002..., it shouldn't replace any file)

or

"c:\temp\capture_YY-MM-DD_HH-MM-SS.jpg" (date and time)
xnview wrote:
currently xnview is opened in browser (probably due to startup option)
When you use -capture, the browser is opened???? I can't reproduce...
Yes, try these options:

General > Startup > [x] Launch...

and

General > Startup > Startup dir. > Specified > C:\
Dreamer

User avatar
xnview
Author of XnView
Posts: 31362
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Mon Jul 30, 2007 1:12 pm

Dreamer wrote:
xnview wrote:
currently xnview is opened in browser (probably due to startup option)
When you use -capture, the browser is opened???? I can't reproduce...
Yes, try these options:

General > Startup > [x] Launch...

and

General > Startup > Startup dir. > Specified > C:\
Strange, i can't reproduce this bug!
Pierre.

User avatar
Dreamer
XnThusiast
Posts: 4605
Joined: Sun Jul 25, 2004 9:08 pm
Location: Slovakia

Post by Dreamer » Tue Jul 31, 2007 12:30 am

Pierre, do you want my ini?

What about other users?
Dreamer

Post Reply