use const d everywhere
[kdegraphics.git] / doc / ksnapshot / index.docbook
blobcf12af50cd7d140b1505200868a61768c29a1e32
1 <?xml version="1.0" ?>
2 <!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
3 <!ENTITY kappname "&ksnapshot;">
4 <!ENTITY package "kdegraphics">
5 <!ENTITY % addindex "IGNORE">
6 <!ENTITY % English "INCLUDE" > <!-- change language only here -->
7 ]>
9 <book lang="&language;">
11 <bookinfo>
12 <title>The &ksnapshot; Handbook</title>
14 <authorgroup>
15 <author>
16 <firstname>Richard</firstname>
17 <othername>J.</othername>
18 <surname>Moore</surname>
19 <affiliation>
20 <address>&Richard.J.Moore.mail;</address>
21 </affiliation>
22 </author>
24 <author>
25 <firstname>Robert</firstname>
26 <othername>L.</othername>
27 <surname>McCormick</surname>
28 <affiliation>
29 <address>&Robert.L.McCormick.mail;</address>
30 </affiliation>
31 </author>
33 <author>
34 <firstname>Brad</firstname>
35 <surname>Hards</surname>
36 <affiliation>
37 <address>&Brad.Hards.mail;</address>
38 </affiliation>
39 </author>
41 <othercredit role="reviewer">
42 <firstname>Lauri</firstname>
43 <surname>Watts</surname>
44 <affiliation>
45 <address>&Lauri.Watts.mail;</address>
46 </affiliation>
47 <contrib>Reviewer</contrib>
48 </othercredit>
50 <othercredit role="developer">
51 <firstname>Richard</firstname>
52 <othername>J</othername>
53 <surname>Moore</surname>
54 <affiliation>
55 <address>&Richard.J.Moore.mail;</address>
56 </affiliation>
57 <contrib>Developer</contrib>
58 </othercredit>
60 <othercredit role="developer">
61 <firstname>Matthias</firstname>
62 <surname>Ettrich</surname>
63 <affiliation>
64 <address>&Matthias.Ettrich.mail;</address>
65 </affiliation>
66 <contrib>Developer</contrib>
67 </othercredit>
69 <!-- TRANS:ROLES_OF_TRANSLATORS -->
70 </authorgroup>
72 <copyright>
73 <year>1997-2000</year>
74 <holder>&Richard.J.Moore;</holder>
75 </copyright>
77 <copyright>
78 <year>2000</year>
79 <holder>&Matthias.Ettrich;</holder>
80 </copyright>
82 <legalnotice>&FDLNotice;</legalnotice>
84 <date>2006-07-05</date>
85 <releaseinfo>0.7</releaseinfo>
87 <abstract>
88 <para>&ksnapshot; is a simple applet for taking screenshots. It is capable
89 of capturing images of the whole desktop, a single window, a section of a window or a selected
90 region. The images can then be saved in a variety of formats.</para>
91 </abstract>
93 <keywordset>
94 <keyword>KDE</keyword>
95 <keyword>KSnapshot</keyword>
96 <keyword>kdegraphics</keyword>
97 <keyword>screen capture</keyword>
98 <keyword>screen grab</keyword>
99 </keywordset>
101 </bookinfo>
103 <chapter id="introduction">
104 <title>Introduction</title>
106 <para>&ksnapshot; is a simple applet for taking screenshots. It is capable
107 of capturing images of the whole desktop, a single window, a section of a window or a selected
108 region. The images can then be saved in a variety of formats.</para>
110 <para>Please report any problems or feature requests to the <ulink
111 url="http://bugs.kde.org/wizard.cgi">&kde; Bug Tracking System</ulink></para>
113 </chapter>
115 <chapter id="using-ksapshot">
116 <title>Using &ksnapshot;</title>
118 <para>This chapter describes the use of &ksnapshot; for capturing screen
119 images.</para>
121 <sect1 id="starting">
122 <title>Starting &ksnapshot;</title>
124 <para>&ksnapshot; may be started by one of several ways as described
125 below.</para>
127 <itemizedlist>
128 <listitem>
129 <para>You may start &ksnapshot; by selecting it from the <menuchoice>
130 <guimenu>K-Menu</guimenu><guisubmenu>Graphics</guisubmenu>
131 <guimenuitem>&ksnapshot; (Screen Capture Program)</guimenuitem></menuchoice>.
132 </para></listitem>
133 <listitem>
134 <para>You may start &ksnapshot; by entering the following at the command
135 prompt:</para>
136 <screen width="40">
137 <prompt>%</prompt> <command>ksnapshot &amp;</command>
138 </screen>
139 </listitem>
140 <listitem><para>The mini command line (invoked with
141 <keycombo action="simul">&Alt;<keycap>F2</keycap></keycombo>) may
142 also be used to start &ksnapshot;</para></listitem>
143 </itemizedlist>
145 <para>Once &ksnapshot; starts, you will see a window like the following:
146 <mediaobject>
147 <imageobject>
148 <imagedata fileref="window.png" format="PNG"/>
149 </imageobject>
150 <textobject><phrase>&ksnapshot; Preview Window</phrase>
151 </textobject>
152 </mediaobject>
153 </para>
155 </sect1>
157 <sect1 id="taking-snapshot">
158 <title>Taking A Snapshot</title>
160 <para> &ksnapshot; grabs an image of your entire desktop immediately after it is
161 started, but before it displays itself on screen. This allows you to quickly
162 create full-desktop screenshot images.</para>
164 <para>The snapshot taken by &ksnapshot; is displayed in the preview window,
165 which is located in the upper left of the &ksnapshot; application window.
166 Below is an example of the preview window from &ksnapshot;. Your preview
167 will differ depending on what you have displayed on the desktop.</para>
169 <mediaobject>
170 <imageobject>
171 <imagedata fileref="preview.png" format="PNG"/>
172 </imageobject>
173 <textobject><phrase>&ksnapshot; Preview Window</phrase>
174 </textobject>
175 </mediaobject>
177 <para>The snapshot can be saved by clicking on
178 the <guibutton>Save As...</guibutton> button. This opens the standard &kde; save dialog,
179 where you can choose the filename, the folder location, and the format that your snapshot
180 will be saved in. If multiple snapshots are taken, the
181 filename is automatically incremented to prevent you from overwriting previous
182 snapshots. You may however edit the filename to anything you wish, including the name
183 of a previously saved snapshot. </para>
185 <para>To take a snapshot of a single window, select the <guilabel>Window
186 Under Cursor</guilabel> combo box entry (next to the <guilabel>Capture mode:</guilabel>
187 label), and then click on the <guibutton>New Snapshot</guibutton> button.</para>
189 <para>Depending on your <guilabel>Snapshot delay:</guilabel> settings you
190 get either a cross as the mouse pointer (for <guilabel>No delay</guilabel>),
191 or a standard mouse cursor which you can use to work with a program until
192 the delay is over and a snapshot is taken.</para>
194 <para>With <guilabel>No delay</guilabel>, the snapshot is taken immediately when you
195 click into a window.</para>
197 <para>&ksnapshot; will display the new snapshot in the preview
198 area, at which time you can choose to save the new image (by pressing
199 <guibutton>Save As...</guibutton>)
200 or to grab a new one, by pressing the
201 <guibutton>New Snapshot</guibutton> button.</para>
203 <para>To take a new snapshot of the entire desktop, select the
204 <guilabel>Full Screen</guilabel> combo box entry and then click on the
205 <guibutton>New Snapshot</guibutton> button.
206 &ksnapshot; will now capture the entire desktop if you press
207 <guibutton>New Snapshot</guibutton>.</para>
209 <para>Similarly, to take a snapshot of a region, select the
210 <guilabel>Region</guilabel> combo box entry and set the
211 <guilabel>Snapshot delay</guilabel> to <guilabel>No delay</guilabel>,
212 and then click on the <guibutton>New Snapshot</guibutton> button. The
213 mouse cursor will then change into a cross, and you can then use the
214 mouse to select the region you want to capture. </para>
216 <para>To take a new snapshot of a section of a window, select the
217 <guilabel>Section of Window</guilabel> combo box entry and then click on the
218 <guibutton>New Snapshot</guibutton> button. With <guilabel>No delay</guilabel>
219 you get a cross as the mouse pointer and you have to click once with the &LMB; into
220 the window. The section of the window under the mouse cursor is now highlighted
221 with a red border. Move the mouse to the wanted section and click the &LMB;
222 to capture the screenshot.
223 </para>
225 </sect1>
227 <sect1 id="additional-features">
228 <title>Additional Features</title>
230 <sect2 id="delay">
231 <title>Snapshot Delay</title>
233 <para>The <guilabel>Snapshot Delay:</guilabel> box allows you to enter an
234 arbitrary time delay, in seconds, between the time that you press the
235 <guibutton>New Snapshot</guibutton> button and the time that the snapshot is
236 taken.</para>
238 <para>When a delay time has been set, you do not have to click the mouse
239 button to capture a screenshot. This enables you to open a drop down menu,
240 and take a picture of it.</para>
242 </sect2>
244 <sect2 id="window-decoration">
245 <title>Exclude Window decorations</title>
247 <para><guilabel>Include window decorations</guilabel> is enabled by default.</para>
249 <para>When you only want to capture the application itself without the surrounding
250 window decoration, disable this option and take a new snapshot.</para>
252 </sect2>
254 <sect2 id="print-snapshot">
255 <title>Print</title>
257 <para>When you want to print your snapshot from the preview, just click
258 <guibutton>Print...</guibutton> and you get the standard &kde; Print dialog, from
259 where you can directly print your snapshot.</para>
260 </sect2>
262 <sect2 id="copy-snapshot">
263 <title>Copy to Clipboard</title>
265 <para>When you want to edit your snapshot in a graphics application without saving
266 the snapshot, just click <guibutton>Copy to Clipboard</guibutton> and insert the image
267 into a viewer or graphics application.</para>
268 </sect2>
271 <sect2 id="bottom-buttons">
272 <title>Buttons</title>
274 <para>There are two further buttons located at the bottom of the
275 &ksnapshot; window. Their function is described below.</para>
277 <variablelist>
278 <varlistentry>
279 <term><guibutton>Help</guibutton></term>
280 <listitem><para>Gives you a menu where you can open the
281 <guimenuitem>&ksnapshot; Handbook</guimenuitem>, report a bug or
282 get some more information <guimenuitem>About &ksnapshot;</guimenuitem>
283 and <guimenuitem>About &kde;</guimenuitem>.
284 </para></listitem>
285 </varlistentry>
287 <varlistentry>
288 <term><guibutton>Quit</guibutton></term>
289 <listitem><para>Quits the &ksnapshot; application.</para></listitem>
290 </varlistentry>
291 </variablelist>
293 </sect2>
294 </sect1>
295 </chapter>
297 <chapter id="dcop">
299 <title>&DCOP; Interface</title>
301 <para>&ksnapshot; can be scripted using its &DCOP; interface. This
302 chapter explains the various &DCOP; calls that you can use, and
303 provides some examples of how you can use them.</para>
305 <para>As with all &DCOP; calls, you need to specify the application
306 you want to interface with, and the particular interface. With &ksnapshot;
307 you need to identify which particular application, which is
308 <literal>ksnapshot-</literal> followed by the process number.</para>
310 <para>To start &ksnapshot; and obtain the right argument, use
311 <command>dcopstart ksnapshot</command>, which returns the
312 argument (such as <computeroutput>ksnapshot-20594</computeroutput>) on
313 standard output.</para>
315 <para>You can get a list of the available &DCOP; interfaces, use
316 the right arguments, as shown in this example:
317 <screen width="60">
318 <prompt>$</prompt> <command>dcop `dcopstart ksnapshot` interface</command><computeroutput>
319 QCStringList interfaces()
320 QCStringList functions()
321 QString url()
322 void slotGrab()
323 void slotPrint()
324 void slotSave()
325 bool save(QString filename)
326 void slotSaveAs()
327 void slotCopy()
328 void setTime(int newTime)
329 int timeout()
330 void setURL(QString newURL)
331 void setGrabMode(int grab)
332 int grabMode()
333 void slotMovePointer(int x,int y)
334 void exit()
335 </computeroutput>
336 </screen>
337 </para>
339 <para>
340 In the examples following, the process is always
341 <computeroutput>ksnapshot-23151</computeroutput>.
342 </para>
344 <sect1 id="dcop-settings">
346 <title>&DCOP; Access to Settings</title>
348 <para>For each of the settings that you can control with the
349 &GUI;, you can both obtain the current status of that setting,
350 and modify the setting, using &DCOP;.
351 </para>
353 <para>You can obtain the current capture mode using
354 <literal>grabMode</literal>, as shown below:
355 <screen width="60">
356 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface grabMode</command>
357 </screen>
358 This will return <computeroutput>0</computeroutput> for full-screen capture,
359 <computeroutput>1</computeroutput> for window capture, and <computeroutput>2</computeroutput>
360 for region capture.
361 </para>
363 <para>You can set the capture mode using <literal>setGrabMode</literal>,
364 which requires an argument to identify the mode required (as for <literal>grabMode</literal>).
365 So you can set window capture mode (<command>1</command>), using:
366 <screen width="60">
367 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface setGrabMode 1</command>
368 </screen>
369 </para>
371 <para>You can obtain the current timeout setting (the <guilabel>Snapshot delay:</guilabel>
372 &GUI; item) using <literal>timeout</literal>, as shown below:
373 <screen width="60">
374 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface timeout</command>
375 </screen>
376 This will return the timeout setting in seconds, or zero if there is no delay
377 (capture on click).
378 </para>
380 <para>You can set the timeout using <literal>setTime</literal>,
381 which requires an argument to identify the timeout duration. So you can
382 set a delay of 4 seconds using:
383 <screen width="60">
384 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface setTime 4</command>
385 </screen>
386 </para>
388 <para>You can obtain the path that the snapshot will be saved to using
389 <literal>url</literal>, as shown below:
390 <screen width="60">
391 <prompt>$</prompt><command>dcop ksnapshot-23151 interface url</command>
392 </screen>
393 This will return the filename, as a &URL; (eg as
394 <computeroutput>file:///home/bradh/test2.png</computeroutput>).
395 </para>
397 <para>You can set the path using <literal>setURL</literal>,
398 which requires a string argument to identify the new path. So you can
399 set the path to <literal>file:///home/bradh/snapshot.jpg</literal>
400 using:
401 <screen width="60">
402 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface setURL file:///home/bradh/snapshot.jpg</command>
403 </screen>
404 </para>
406 </sect1>
408 <sect1 id="dcop-snapshot">
409 <title>Taking Screenshots with &DCOP;</title>
411 <para>
412 The key to taking screenshots with &DCOP; is use of <literal>slotGrab</literal>,
413 as shown below:
414 <screen width="60">
415 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface slotGrab</command>
416 </screen>
417 </para>
419 <para>
420 This will take a snapshot using the current snapshot mode and timeout settings
421 (as described above). If you want to save the snapshot image, there are a
422 number of calls you can use. If you just want to save the image to the current
423 path (as returned by <literal>url</literal> or changed by
424 <literal>setURL</literal>), you can use <literal>slotSave</literal>, as shown
425 below:
426 <screen width="60">
427 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface slotSave</command>
428 </screen>
429 </para>
431 <para>
432 If you want the user to be able to specify a filename (and path), you can use
433 <literal>slotSaveAs</literal>, which will bring up a standard &kde; file
434 save dialog.</para>
436 <para>
437 If you want to save the image to a different name (or path) without
438 changing the path with <literal>setURL</literal>, you can use
439 <literal>save</literal>, providing the &URL; to save to as an argument. So if you
440 want to save the snapshot to <filename>file:///tmp/tempshot.png</filename>, you
441 can do the following:
442 <screen width="60">
443 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface save file:///tmp/tempshot.png</command>
444 </screen>
445 Note that this will return true if the snapshot was successfully saved, and false
446 otherwise. Also, you should be aware that if the file already exists, the user
447 will get a standard &kde; dialog that requires the user to decide whether to overwrite
448 or not.
449 </para>
451 <para>
452 In addition to saving the snapshot, you can also copy it to the clipboard, using
453 <literal>slotCopy</literal>, as shown below:
454 <screen width="60">
455 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface slotCopy</command>
456 </screen>
457 </para>
459 <para>
460 If you need to select a window that may not be under the mouse cursor, you
461 can use <literal>slotMovePointer</literal>, passing the x position
462 (in screen pixels) and the y position (also in screen pixels) as arguments.
463 So to move the mouse to the top left hand corner of the screen (0,0), you
464 can do the following:
465 <screen width="60">
466 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface slotMoveMouse 0 0</command>
467 </screen>
468 </para>
469 </sect1>
471 <sect1 id="dcop-print">
472 <title>Printing Screenshots with &DCOP;</title>
474 <para>
475 You can print the current screenshot (which may or may not have been saved)
476 using <literal>printSlot</literal>, as shown below:
477 <screen width="60">
478 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface slotPrint</command>
479 </screen>
480 </para>
482 <para>
483 Note that this will bring up the normal &kde; print dialog, which may require
484 user interaction.
485 </para>
487 </sect1>
489 <sect1 id="dcop-exit">
490 <title>&DCOP; Application control</title>
492 <para>
493 You can cause &ksnapshot; to exit by using <literal>exit</literal>,
494 as shown below.
495 <screen width="60">
496 <prompt>$</prompt> <command>dcop ksnapshot-23151 interface exit</command>
497 </screen>
498 </para>
500 </sect1>
502 </chapter>
504 <chapter id="credits">
506 <title>Credits and License</title>
508 <para>Program copyright</para>
509 <itemizedlist>
510 <listitem><para>1997-2000 &Richard.J.Moore; &Richard.J.Moore.mail;</para></listitem>
511 <listitem><para>2000 &Matthias.Ettrich; &Matthias.Ettrich.mail;</para></listitem>
512 </itemizedlist>
514 <para>Documentation based on the original, copyright 1997-2000 &Richard.J.Moore;
515 &Richard.J.Moore.mail;</para>
516 <!-- TRANS:CREDIT_FOR_TRANSLATORS -->
518 &underFDL;
519 &underGPL;
521 </chapter>
523 &documentation.index;
524 </book>
526 <!--
527 Local Variables:
528 sgml-minimize-attributes: nil
529 sgml-general-insert-case: lower
530 End: