📄 0252-0255.html
字号:
<HTML>
<HEAD>
<TITLE>Developer.com - Online Reference Library - 0672311623:SAMS TEACH YOURSELF LINUX IN 24 HOURS:Graphics Tools</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311623 //-->
<!-- TITLE=SAMS TEACH YOURSELF LINUX IN 24 HOURS //-->
<!-- AUTHOR=BILL BALL, STEPHEN SMOOGEN //-->
<!-- PUBLISHER=MACMILLAN //-->
<!-- IMPRINT=SAMS //-->
<!-- PUBLICATION DATE=1998 //-->
<!-- CHAPTER=16 //-->
<!-- PAGES=0243-0258 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0249-0251.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0256-0258.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-252"><P>Page 252</P></A>
<UL>
<LI> import Window capture utility; requires X11
<LI> mogrify Convert or change, then overwrite multiple graphic files
<LI> montage combines several graphics into a larger graphic
</UL>
<P>You'll really like ImageMagick's display
command, which has more than 75 different features and effects you can use to edit or
change graphic images. One interesting feature is
the ability to load images into a visual directory so you can see thumbnails of all images in
a directory. Using the display command is easy, but you must be running the X
Window System. From a terminal command line, type the following:
</P>
<!-- CODE SNIP //-->
<PRE>
# display &
</PRE>
<!-- END CODE SNIP //-->
<P>This starts the program. To see a visual directory of your graphics, type the following:
</P>
<!-- CODE SNIP //-->
<PRE>
# display `vid:*.gif' &
</PRE>
<!-- END CODE SNIP //-->
<P>This command line loads all .gif graphics in the current directory. Once the program
starts, access its menus by pressing the left mouse button when your cursor is over the
images window. The display command imports and exports 58 different graphics formats.
The program features built-in help, and also can create slide shows of graphics (see Figure 16.2).
</P>
<P>For more information about ImageMagick, see its manual page, and the manual pages for the other programs in the distribution. Comprehensive hypertext documentation is under
</P>
<P>Figure 16.2<BR>
The display X11 client,<BR> included with the<BR> ImageMagick
software<BR> package, can be used<BR> to make changes to<BR> many different
types<BR> of graphics.<BR>
<a href="javascript:displayWindow('images/ch16fg02.jpg', 288, 216)"><img src="images/tn_ch16fg02.jpg"></a><BR>
</P>
<A NAME="PAGENUM-253"><P>Page 253</P></A>
<p>
the /usr/doc/ImageMagick directory.
</p>
<H4><A NAME="ch16_ 8">
Using the xv Command to View Graphics
</A></H4>
<P>The xv command is a handy previewer used to review, crop, scale, edit, or convertgraphics. This command offers many sophisticated sizing and color controls, and you also canuse xv, found under the /usr/X11R6/bin directory, to capture windows of your X11 session(you must run X11 in order to use the xv command).
</P>
<P>The xv command loads a single file or series of graphics if you specify the files on
the command line:
</P>
<!-- CODE SNIP //-->
<PRE>
# xv *.jpg
</PRE>
<!-- END CODE SNIP //-->
<P>This command line loads all files ending in .jpg in the current directory. After the files
are loaded, scroll through a list of files to make your changes, or use a graphic directory to
select your files (see Figure 16.3).
</P>
<P>The xv command can import and export 18 different graphics file formats, and also prints</P>
<P>Figure 16.3<BR>
The xv command is an<BR> X11 client that loads,<BR> edits, captures,
saves,<BR> or prints images, and<BR> features
sophisticated<BR>
color controls.<BR>
<a href="javascript:displayWindow('images/ch16fg03.jpg', 288, 216)"><img src="images/tn_ch16fg03.jpg"></a><BR>
</P>
<P>graphics. For more information about using xv, see its manual page, or read the
definitive documentation (128 pages in PostScript format, nearly as many as the
xv command's 107 command-line options!) found under the
/usr/doc/xv directory.
</P>
<H4><A NAME="ch16_ 9">
Using the gv Command to View PostScript Files
</A></H4>
<A NAME="PAGENUM-254"><P>Page 254</P></A>
<P>The gv command is a PostScript previewer used to examine or read PostScript
graphics or documents before printing. You must run the X Window System to use this program. The gv command, found under the
/usr/X11R6/bin directory, is a much-improved
previewer by Johannes Plass, and is based on the previous ghostview program by Tim Theilson
(you'll find a symbolic link under /usr/X11R6/bin called ghostview, which points to gv).
</P>
<P>The gv command has more than 36 different command-line options,
and uses a number of X11 Toolkit options, such as geometry settings. You can start
gv by itself, or specify a file on the command line, along with its options:
</P>
<!-- CODE SNIP //-->
<PRE>
# gv -geometry 640x480 myfile.ps
</PRE>
<!-- END CODE SNIP //-->
<P>
This command line starts the gv command in a 640 by 480 pixel window with the
file myfile.ps displayed. Another great feature of the
gv command is that it reads portable document format, or .pdf files (see Figure 16.4). This is a handy way to read .pdf documents
without installing an additional .pdf reader, such as Adobe Acrobat.
</P>
<P>The gv command also uses a unique scrolling mechanism; instead of scrollbars
alongside</P>
<P>Figure 16.4<BR>
The gv X11 client<BR> displays PostScript or<BR> PDF documents
and<BR> graphics, and provides<BR> an easy-to-use inter-<BR>
face to previewing
files<BR> before printing.<BR>
<a href="javascript:displayWindow('images/ch16fg04.jpg', 288, 216)"><img src="images/tn_ch16fg04.jpg"></a><BR>
</P>
<P>
or below the document window, a rectangular button controls the document viewing
area. You also can print whole documents or selected pages by using different commands.
</P>
<P>You'll find a comprehensive manual page, along with a hypertext series of .html files under the /usr/doc/gv directory.
</P>
<H4><A NAME="ch16_ 10">
Painting and Drawing with xpaint and xfig
</A></H4>
<A NAME="PAGENUM-255"><P>Page 255</P></A>
<P>If you need to create or edit simple bitmap graphics, use David Koblas' xpaint
program, found under the /usr/X11R6/bin directory. For technical drawing, you'll also find the
xfig program, which uses drawing objects (with handles), rather than a flat canvas.
</P>
<P>The xpaint program features a floating control window with tools, and a separate
canvas window with color palettes for selecting or mixing colors. The xpaint program has
several different command-line options, and also can use a resource file, called
.Xpaintrc (located in your home directory), to customize colors and patterns. You can load graphics from
the command line:
</P>
<!-- CODE SNIP //-->
<PRE>
# xpaint mygraphic.bmp
</PRE>
<!-- END CODE SNIP //-->
<P>The xpaint program starts, presents the image in an editing window, and displays a
floating window of tools (see Figure 16.5). Xpaint imports eight and exports 10 different
file formats. You also may have multiple windows with different images waiting to be edited.</P>
<P>If you'd rather work with a drawing program, try the xfig program (see Figure 16.6).Like</P>
<P>Figure 16.5<BR>
The xpaint X11 client<BR> is a simple bitmap<BR> editing program with
a<BR> fatbits mode, multiple<BR> windows, and image<BR> filters.<BR>
<a href="javascript:displayWindow('images/ch16fg05.jpg', 288, 216)"><img src="images/tn_ch16fg05.jpg"></a><BR>
</P>
<P>xpaint, you must run X11 in order to use this program. You should have an X11
display of at least 1024 pixels high by 768 pixels wide in order to use this program (although
you can use it with an 800-by-600 display, you'll miss some tools on the xfig window).
</P>
<P>Starting the xfig program is easy, and you can control the initial size of its drawing
area by using the -ph and -pw command-line options. For example,
</P>
<!-- CODE SNIP //-->
<PRE>
# xfig -ph 6 -pw 8 &
</PRE>
<!-- END CODE SNIP //-->
<P>This command line starts the xfig program with a canvas six inches high by eight inches</P>
<P><CENTER>
<a href="0249-0251.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0256-0258.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -