⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch11.htm

📁 delphi自学的好教材!特别适合刚刚起步学习delphi的人员!同样对使用者具有参考价值!
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD><SCRIPT LANGUAGE="JavaScript"><!--function popUp(pPage) { var fullURL = document.location; var textURL = fullURL.toString(); var URLlen = textURL.length; var lenMinusPage = textURL.lastIndexOf("/"); lenMinusPage += 1; var fullPath = textURL.substring(0,lenMinusPage); popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394'); figDoc= popUpWin.document; zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>'; zhtm += '</head>'; zhtm += '<BODY bgcolor="#FFFFFF">'; zhtm += '<IMG SRC="' + fullPath + pPage + '">'; zhtm += '<P><B>' + pPage + '</B>'; zhtm += '</BODY></HTML>'; window.popUpWin.document.write(zhtm); window.popUpWin.document.close(); // Johnny Jackson 4/28/98 }//-->                                                                </SCRIPT><link rel="stylesheet" href="/includes/stylesheets/ebooks.css">	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">	<TITLE>Teach Yourself Borland Delphi 4 in 21 Days -- Ch 11 -- Delphi Tools and Options</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><CENTER><H1><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"></H1><H1><BR>Teach Yourself Borland Delphi 4 in 21 Days</H1></CENTER><CENTER><P><A HREF="../ch10/ch10.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch12/ch12.htm"><IMGSRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> <HR></CENTER><CENTER><H1>- 11 -</H1><H1>Delphi Tools and Options</H1></CENTER><UL>	<LI><A HREF="#Heading1">Using the Image Editor</A>	<UL>		<LI><A HREF="#Heading2">Foreground and Background Colors</A>		<LI><A HREF="#Heading3">Transparent and Inverted Colors</A>		<LI><A HREF="#Heading4">Image Editor Drawing Tools</A>		<LI><A HREF="#Heading5">Zooming</A>		<LI><A HREF="#Heading6">The Line Width Palette</A>		<LI><A HREF="#Heading7">Working with Bitmap Files</A>		<LI><A HREF="#Heading8">Working with Icons</A>		<LI><A HREF="#Heading9">Working with Cursors</A>		<LI><A HREF="#Heading10">Image Editor Context Menus</A>	</UL>	<LI><A HREF="#Heading11">WinSight: Spying on Windows</A>	<UL>		<LI><A HREF="#Heading12">The Windows Messaging System</A>		<LI><A HREF="#Heading13">The Message Trace Window</A>		<LI><A HREF="#Heading14">Spying on a Window</A>		<LI><A HREF="#Heading15">Message Trace Options</A>		<LI><A HREF="#Heading16">Other WinSight Features</A>	</UL>	<LI><A HREF="#Heading17">TDUMP</A>	<LI><A HREF="#Heading18">CallWindowProcA</A>	<LI><A HREF="#Heading19">The Package Collection Editor</A>	<LI><A HREF="#Heading20">Configuring the Delphi Tools Menu</A>	<UL>		<LI><A HREF="#Heading21">Using the Configure Tools Dialog Box</A>		<LI><A HREF="#Heading22">Adding Tools to the Menu</A>	</UL>	<LI><A HREF="#Heading23">Setting the Environment Options</A>	<UL>		<LI><A HREF="#Heading24">The Preferences Page</A>		<LI><A HREF="#Heading25">The Library Page</A>		<LI><A HREF="#Heading26">The Palette Page</A>	</UL>	<LI><A HREF="#Heading27">Summary</A>	<UL>		<LI><A HREF="#Heading28">Q&amp;A</A>		<LI><A HREF="#Heading29">Quiz</A>		<LI><A HREF="#Heading30">Exercises</A>	</UL></UL><P><HR SIZE="4"><CENTER><H1></H1></CENTER><P>Delphi comes with several tools to aid in your application development. Todayyou learn about some of Delphi's tools. Specifically, you learn about the following:</P><P><UL>	<LI>The Image Editor	<P>	<LI>Messages and the Windows messaging system	<P>	<LI>WinSight	<P>	<LI>Package Collection Editor	<P>	<LI>Configuring the Tools menu	<P>	<LI>Delphi Environment Options</UL><P>First, you take a general look at these tools. Then you learn how to add yourown tools to the Delphi Tools menu. The day ends with a look at the Delphi EnvironmentOptions dialog box.</P><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> In addition to the tools listed here, Delphi also comes with a host	of database tools such as Database Desktop, BDE Administrator, SQL Builder, and SQL	Explorer. A discussion of those tools would be too lengthy for today's purposes.<HR></BLOCKQUOTE><H2><A NAME="Heading1"></A>Using the Image Editor</H2><P>The Delphi Image Editor is a tool that enables you to create and edit bitmaps(.bmp), icons (.ico), and cursors (.cur). You can also create a resource projectcontaining multiple bitmaps, icons, and cursors in a single resource file (.res).The resource file can then be added to your Delphi project, and you can use the resourcesas needed. Figure 11.1 shows the Image Editor editing a bitmap.</P><P><A HREF="javascript:popUp('28671101.gif')"><B>FIGURE 11.1.</B></A><B> </B><I>TheImage Editor.</I></P><P><I></I><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> All Windows images are bitmaps, whether they are actual Windows bitmap	files (.bmp) or icons or cursors. In this chapter, I refer to all images collectively	as <I>bitmaps</I>. <BR>	</P>	<P>Image Editor deals only with Windows bitmap files. Other file formats such as	PCX, TIFF, JPEG, and GIF are not supported. <HR></BLOCKQUOTE><P>You can start the Image Editor by either double-clicking on the Image Editor iconin the Delphi folder or choosing Tools|Image Editor from the Delphi main menu. TheImage Editor is a stand-alone program and doesn't have to be run from the DelphiIDE.</P><P><H3><A NAME="Heading2"></A>Foreground and Background Colors</H3><P>The Image Editor enables you to create 2-color, 16-color, and, in the case ofbitmap files, 256-color images. You can choose any available colors when drawingon a bitmap. In the bottom-left corner of the Image Editor are two boxes containingthe current foreground and background colors. (The foreground color is representedby the far left box.)</P><P>When using a drawing tool, you can draw with either the foreground color or thebackground color. To draw with the foreground color, use the left mouse button. Forexample, if you choose the filled rectangle tool and draw a rectangle on the bitmap,the rectangle will be filled with the foreground color. To draw a filled rectanglewith the background color, use the right mouse button to drag the rectangle. Thesame is true for most of the other drawing tools.</P><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> The Text tool uses only the foreground color. You cannot place text	with the background color. If you want to use the background color, you have to change	the foreground color and then place your text.<HR></BLOCKQUOTE><P>To change the foreground color, click a color on the color palette with the leftmouse button. (The color palette is located along the bottom of the Image Editorwindow.) When you choose a new foreground color, the square that represents the foregroundcolor changes to show the new color selected. To change the background color, clicka color in the color palette with your right mouse button.</P><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> If you are editing a 256-color image, the color palette will have	scroll buttons on either side so that you can scroll through the available colors.<HR></BLOCKQUOTE><P>The colors that appear in the color palette are determined by the bitmap whenyou are loading a bitmap that already exists. If you are starting a new 256-colorimage, the default 256-color palette is used.</P><P>You can also set the foreground or background colors with the Eyedropper tool.The Eyedropper enables you to set the foreground or background color by picking upa color that is already used on the image.</P><P>To set the foreground color with the Eyedropper, choose the Eyedropper tool fromthe Tools palette, place the tip of the Eyedropper over a portion of the image thathas the color you want to use, and then click the left mouse button. The foregroundcolor changes to the color under the Eyedropper. To set the background color, clickwith your right mouse button instead of the left mouse button. The Eyedropper toolis invaluable when you want to exactly match a color that was previously used onyour bitmap.</P><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> The foreground and background colors might work differently in the	Image Editor than in other bitmap editors you have used. For example, in some bitmap	editors, the outline of a filled rectangle is drawn with the foreground color and	filled with the background color. With the Image Editor, filled objects have no discernible	border. A filled rectangle is in either the foreground or the background color. <HR></BLOCKQUOTE><H3><A NAME="Heading3"></A>Transparent and Inverted Colors</H3><P>In the case of icons and cursors, you can also choose the transparent color (theword <I>color</I> being relative here). When you use the transparent color, the backgroundbeneath the icon shows through wherever the transparent color is used. That couldmean the Windows background in the case of a shortcut, or it could mean the titlebar of your application.</P><P>Whether you use the transparent color depends on your personal tastes and theparticular icon you are creating. In the case of cursors, you will almost alwaysuse the transparent color as the background for the icon. Rarely do you have a cursorthat appears as a solid block.</P><P>Choosing the inverted color causes the background underneath the icon to be inverted(like reverse video). Use of the inverted color isn't common, but it is there ifand when you need it.</P><P>Both the transparent and inverted colors are shown next to the color palette whenediting icons and cursors. They are represented by color squares with a curved linerunning through them.</P><BLOCKQUOTE>	<P><HR><strong>NOTE:</strong> By default, new icon and new cursor resources have the background	filled with the transparent color. <HR></BLOCKQUOTE><H3><A NAME="Heading4"></A>Image Editor Drawing Tools</H3><P>The Image Editor drawing tools are similar to most paint programs. Because theseare common drawing tools, I'm not going to go over each and every one. Fifteen minutesof experimentation with the Image Editor will be more beneficial than anything Ican tell you. Fire up the Image Editor and experiment with it for a while. I'll wait.</P><P>At the top of the Image Editor Tools palette, you find the Marquee and Lasso tools.These work in essentially the same way, so I'll cover them together. Both tools enableyou to select a region on the current image. The Marquee tool is used to define a

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -