请选择 进入手机版 | 继续访问电脑版


查看: 3538|回复: 2

[程序] 屏幕截图小窍门 [Top Screenshot Tips]

发表于 2010-12-9 15:47:11 | 显示全部楼层 |阅读模式
本帖最后由 Captaintiger 于 2010-12-9 16:03 编辑

屏幕截图小窍门 [Top Screenshot Tips]
原文出处:http://www.oreillynet.com/pub/h/274    译者:Captaintiger

These screen-capture tips provide built-in and add-on solutions to just about anything you might wish to snap.
[Discuss (4) | Link to this hack]
Capturing good screenshots in Mac OS X requires some experimentation. If you simply want to capture the screen for reference later on, you can do it easily with the built-in screen-capture tool. However, if you are a professional writer or a student preparing that term paper and need great-looking screen shots, you have to spend a little more time exploring your options.

These screen capture tips provide built-in and add-on solutions to just about anything you might wish to snap.


Mac OS X Jaguar comes with a built-in capability for capturing screenshots. To capture the entire screen, simply press command-Shift-3 and a PDF grab of your current view will appear on your desktop. Screenshots are numbered sequentially, such as Picture 1.pdf, Picture 2.pdf, and so on.

To capture a particular region of the screen, type command-Shift-4 and highlight — using click-and-drag — whatever portion of the screen you'd like.

Figure 1. Capturing a portion of the screen
An extension to region grabbing is snagging a picture of a particular window or dialog box. Press command-Shift-4, then the spacebar; any window you run your mouse over will be highlighted. Click to capture it. You can toggle back and forth between region and window modes by pressing the spacebar.

To change your mind and cancel screen capture, press the Escape (Esc) key on your keyboard.

While the built-in screen-capture tool is good enough for just about all purposes, it has a couple of drawbacks. It doesn't capture the mouse pointer in any of the screenshots — not even optionally. This is a bust for technical writers explaining the operation of menus, buttons, and so forth. Second, while PDF is the be-all and end-all of all things GUI under Mac OS X, I need my screenshots in PNG or TIFF. Sure, I can convert them using Preview or the like [Hack #21], but that's an extra step I simply shouldn't have to take.

Figure 2. The cursor is not captured using screen capture

Mac OS X bundles a little utility called Grab (Applications → Utilities → Grab) which supports three modes of screen capture: screen, selection (a.k.a. region), and timed screen (captures the entire screen after a specific time interval). Unlike its built-in counterpart, Grab saves to TIFF format and optionally includes mouse pointers in its captures; it even allows you to specify a preferred pointer (Grab → Preferences).

Figure 3. Using the timed screen mode to capture action, mouse pointer included
There is one problem that I noticed with the selection capture. In order to capture an active window using the selection mode, you need to switch to Grab first. Yet doing so makes the window inactive and fall to the background. Now, when I do a selection grab, I want to capture the window in its active state.

The selection grab will also display the size of the image you are capturing at the bottom right corner of the selection region. This is useful if you need to capture images of an exact size. One gripe though: you can't create a region of a particular size and then move it about.

Oddly, while Capture → Window is listed, it's grayed out and doesn't appear to be functional.

Using Snapz Pro X
使用Snapz Pro X

The ultimate screen-capture utility is Snapz Pro X ($29, $49 with movie-capture support; 30-day demo available) from Ambrosia Software Inc. (http://www.ambrosiasw.com/utilities/snapzprox/). It sports customizability and multiple output formats, and it grabs the screen as you see it, including or excluding that pesky mouse arrow, at will.
最初的一款屏幕抓取工具是Ambrosia软件公司推出的Snapz Pro X(标准版29美元,支持视频抓取版49美元,试用版可使用30天,http://www.ambrosiasw.com/utilities/snapzprox/)。它号称是可定制性的,能输出多种格式,它抓取你所看到的屏幕界面,可包含或者排除讨厌的鼠标指针,可谓随心所欲。

Set up your shot and press command-Shift-3 (customizable) to freeze the screen and take care of the details. You can choose the entire screen, objects (windows or icons), or a region, even during Quicktime and DVD movie playback (the built-in screen capture featrure is disabled while DVD Player is active).

Figure 4. Taking care of SnapZ Pro X screenshot details
图4. 注意SnapZ Pro X截屏细节

Selection capture, coming after you've set up your screen just the way you like it, allows you to take your time to mark out and alter the region before double-clicking it to take the final shot.

Figure 5. Capturing a portion of the screen
图5. 抓取屏幕的一部分

Snapz Pro X can even capture the drop-shadows beneath a window. Simply change the Border option under Image Options to Drop Shadow. Prior to Snapz Pro X, I'd always have to switch the background to white to capture the nice shadow around the window without including a slice of my desktop image.
Snapz Pro X甚至可以抓取窗口下方的阴影。简单地把Image Options(图像选项)下面的Border option(边沿选项)改成Drop Shadow(阴影)即可。使用Snapz Pro X之前,我总是将桌面背景改为纯白色,以便抓取到窗口边沿的漂亮阴影而不会包含桌面壁纸的残片。

There's so much more to Snapz Pro X — like recording screen activities as a QuickTime movie for purposes such as product demos — that it's difficult to do it justice in this quick overview. Download the 30-day trial and give it a whirl yourself.
还有更多的Snapz Pro X应用——例如将屏幕活动录制为QuickTime影片用于产品展示——在这篇概述文档中有点难以描述,请下载30天试用版自行尝试。

Screen Capture with Terminal

Terminal [Hack #48] comes with a command-line version of the built-in screen-capture utility, aptly named screencapture. For usage instructions, simply invoke it on the command line:
终端 [参考 Hack #48] 可使用内建屏幕抓取工具的命令行版本,相应的命令叫做screencapture。关于使用说明,只要在命令行里调用即可:
  1. % screencapture
  2. screencapture: illegal usage, file required if not going to clipboard
  3. usage: screencapture [-icmwsWx] [file] [cursor]
  4.   -i      capture screen interactively, by selection or window
  5.             control key - causes screen shot to go to clipboard
  6.             space key   - toggle between mouse selection and
  7.                           window selection modes
  8.             escape key  - cancels interactive screen shot
  9.   -c      force screen capture to go to the clipboard
  10.   -m      only capture the main monitor, undefined if -i is set
  11.   -w      only allow window selection mode
  12.   -s      only allow mouse selection mode
  13.   -W      start interaction in window selection mode
  14.   -x      do not play sounds
  15.   file    where to save the screen capture

  16. 命令名称:screencapture
  17. screencapture: 无效应用,如不指定放入剪切板则文件名是必须的
  18. 使用方法: screencapture [-icmwsWx] [文件名] [光标]
  19.   -i        通过区域选择或者窗口进行交互式屏幕抓取
  20.         control键 - 将截图放入剪切板
  21.         空格键 - 在鼠标选取与窗口选取模式间切换
  22.         esc键 - 退出交互式屏幕抓取
  23.   -c        强制将截图放入剪切板
  24.   -m        只抓取主显示器,如果设置了-i参数则无效
  25.   -w        仅允许窗口选取模式
  26.   -s        仅允许鼠标选取模式
  27.   -W        在窗口选取模式下启用交互式抓取
  28.   -x        不播放声音
  29.   file        屏幕截图保存位置
To capture the entire screen, type screencapture ~/Desktop/image.pdf, where ~/Desktop/image.pdf is the path and filename to which you wish it saved. To capture the screen interactively in regional or window mode, use screencapture -i image.pdf.
键入命令screencapture ~/Desktop/image.pdf来抓取整个屏幕,其中~/Desktop/image.pdf是你想保存截图的路径和文件名。而如果想通过区域或窗口模式来交互式抓取屏幕,则使用命令screencapture -i image.pdf。

Figure 6. Using screencapture on the command line
图6. 使用命令行作屏幕抓取

If you prefer the output to go right to the clipboard rather than an image file, use screencapture -c. Of course, you can use these various command-line options in tandem; screencapture -ic, for example, is an interactive screen-capture session, sending the result to the clipboard.
如果你更喜欢将截图输出到剪切板而不是一个图片文件,则使用命令screencapture -c。当然,你可以串联使用多个命令行参数,例如screencapture -ic, 意思是启动一个交互式屏幕抓取会话,并将截图放入剪切板。

You can grab a screenshot of a remote Mac's desktop — or even the login screen — thanks to screencapture and some not-so-fancy remote access footwork [Hack #71]. Simply log in to the other Mac remotely, run screencapture on the command line, and copy the resulting screenshots back over to your local Mac.

—Wei-Meng Lee

你可以从一台Mac桌面上远程抓取屏幕截图——乃至它的登录界面——感谢screencapture命令和一些不需高技巧的远程操作策略 [参考 Hack #71]。 只需远程登入另外那台Mac电脑,在命令行执行screencapture命令,然后把结果传回你的本地Mac电脑即可。
 楼主| 发表于 2010-12-9 16:04:28 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2010-12-9 22:11:51 | 显示全部楼层
本帖最后由 macing2010 于 2010-12-9 22:13 编辑
Captaintiger 发表于 2010-12-9 16:04


回复 支持 反对

使用道具 举报

QQ|小黑屋|手机版|Archiver|苹果发烧友论坛 ( 京ICP备16012027号-3 )

GMT+8, 2018-12-12 08:25 , Processed in 0.016658 second(s), 10 queries , Xcache On.

Powered by Discuz! X3.3 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表