亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch14.htm

?? 24小時精通VC
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>		<TITLE>Teach Yourself Visual C++&#174; 5 in 24 Hours -- Hour 14 -- Icons and Cursors</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><CENTER><H1><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR><FONT COLOR="#000077">Teach Yourself Visual C++&#174; 5 in 24 Hours</FONT></H1></CENTER><CENTER><P><A HREF="../ch13/ch13.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch15/ch15.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><FONT COLOR="#000077">- Hour 14 -<BR>Icons and Cursors</FONT></H1></CENTER><P>Icons and cursors are two commonly used GDI objects. In this hour, you will learnhow to<UL>	<LI>Use icons in your MFC program<BR>	<BR>		<LI>Add icons to button controls<BR>	<BR>		<LI>Manage cursors in your MFC program</UL><P>There are several examples in this hour; you will add icons to pushbutton controls,clip cursors to a specific rectangle, and change the cursor to an hourglass to indicatethat a long process is in progress.<H2><FONT COLOR="#000077"><B>What Is an Icon?</B></FONT></H2><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>An <I>icon</I> is a smallbitmap that represents another object in a Windows program.</P><P>Icons are used to represent minimized child windows in an MDI application. Iconsalso are widely used by Windows itself. When a program is minimized, its icon isdisplayed in the Windows 95 taskbar. When you're using the Explorer, the icon representingan application associated with each file is displayed next to the file's name. Windowsdisplays the program's icon in the upper-left corner of the main window title bar.</P><P>The Windows 95 Explorer uses the icon resources associated with your program whendetermining which icons to display. If large and small icons are available, the Exploreruses the icon resources from your application's EXE file. However, if you provideonly a large icon, the Explorer synthesizes a small icon, which usually results ina small, distorted icon.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>Icons also are	used in dialog boxes. For example, the message dialog boxes discussed in Hour 4,	&quot;Dialog Boxes and C++ Classes,&quot; use icons to indicate the type of message	conveyed. It's also common practice to include an application's icon in the About	dialog box. <HR></BLOCKQUOTE><P>There are several different types of icon resources. In Hour 18, &quot;List ViewControls,&quot; you will use large and small icons in a list view control. Four differenttypes of icons are available:<UL>	<LI>Large icons: Used for most programs written for Windows before the release of	Windows 95, these icons are 32x32 pixels and support 16 colors.<BR>	<BR>		<LI>Small icons: First introduced with Windows 95, these icons are usually a smaller	(16x16 pixels) version of a program's large icon.<BR>	<BR>		<LI>256-color icons: These icons support more than the standard 16 colors available	to other types of icons. These icons are 48x48 pixels, and are never displayed as	a program's icon when the window is minimized.<BR>	<BR>		<LI>Monochrome icons: These icons support only two colors and are 32x32 pixels large.</UL><P>Icons are similar to bitmaps, which are covered in Hour 15, &quot;Using Bitmaps.&quot;However, the code required to use an icon is so simple that there's not even an MFCclass named <TT>CIcon</TT> dedicated to making using icons easier. Instead, you manipulatean <TT>HICON</TT>, or handle to an icon, directly.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Time Saver:</B></FONT><B> </B>An image list is ideal	for collecting icon images. Any image stored in an image list can be converted into	an icon using the <TT>ExtractIcon</TT> member function. Image lists are covered in	Hour 17, &quot;Using Image Lists and Bitmaps.&quot; <HR></BLOCKQUOTE><H2><FONT COLOR="#000077"><B>Creating Icons Using the Image Editor</B></FONT></H2><BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>Because icons are	resources, you add them to a program's resource file just as you do bitmaps, menus,	and dialog boxes. You create new icons using the resource editor. <HR></BLOCKQUOTE><P>When creating a new project, AppWizard creates a set of default icons for yourproject automatically. You can use the Developer Studio image editor to edit or createnew icons for your project.</P><P>To open the image editor, open the ResourceView in the project workspace and thenopen the Icon folder. Double-click any icon resource contained in the folder to openthe editor. In an MDI application created by AppWizard, two icon resources will bedefined for a new project:<UL>	<LI><TT>IDR_MAINFRAME</TT>: An icon that is associated with the application; this	is the MFC cube icon by default.<BR>	<BR>		<LI><TT>IDR_MYAPPTYPE</TT>: Where MyApp is the name of the project. This icon is	used to represent the MDI child window. By default, this icon is the standard MFC	Doc icon.</UL><P>You can change these icon resources to represent the application with which youare working.</P><P>The color palette is displayed whenever you are editing an image resource. Thecolor palette consists of several colored boxes. To change the color of the currentdrawing tool, click the color you want. There are two special color icons in thecolor palette:<UL>	<LI>The <I>transparent</I> color: The background shows through the icon<BR>	<BR>		<LI>The <I>reverse video</I> color: The background shows through after reversing	the video</UL><P>You can find the transparent and reverse video colors on the upper-right cornerof the color palette. Switch to the transparent color by clicking the small videodisplay icon with a green screen, and switch to the reverse video color by clickingthe small video display with the red screen.<H3><FONT COLOR="#000077"><B>Inserting a New Icon Resource</B></FONT></H3><P>To insert a new icon resource into an existing project, right-click the Icon folderin the resource view, and select Insert Icon from the pop-up menu; this opens theimage editor with a blank icon, ready for editing. You can change attributes foricon resources, as with all resources, by double-clicking the edge of the icon resourceor by pressing Alt+Enter on the keyboard.<H3><FONT COLOR="#000077"><B>Loading an Icon</B></FONT></H3><P>After you have added an icon to a project, loading and displaying it requiresthree lines of code. To load an icon and prepare it for display, use the <TT>LoadIcon</TT>function:</P><PRE><FONT COLOR="#0066FF"><TT>HICON hIcon = AfxGetApp()-&gt;LoadIcon( IDI_LOGO );</TT></FONT></PRE><P>Because <TT>LoadIcon</TT> is a <TT>CWinApp</TT> member function, a pointer tothe application's <TT>CWinApp</TT> object must be fetched using the <TT>AfxGetApp</TT>function.</P><P>After the icon has been loaded, display it by calling <TT>DrawIcon</TT>:</P><PRE><FONT COLOR="#0066FF"><TT>pDC-&gt;DrawIcon( 0,0, hIcon );</TT></FONT></PRE><P>The <TT>DrawIcon</TT> function is a member of the <TT>CDC</TT> class. The coordinatesand icon handle must be passed as parameters.</P><P>After using <TT>LoadIcon</TT>, release the icon resource by calling the <TT>DestroyIcon</TT>function:</P><PRE><FONT COLOR="#0066FF"><TT>DestroyIcon( hIcon );</TT></FONT></PRE><BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>CAUTION:</B></FONT><B> </B>If you forget to call	<TT>DestroyIcon</TT>, the memory allocated for the icon isn't released. <HR></BLOCKQUOTE><H3><FONT COLOR="#000077"><B>Changing a Program's Icon</B></FONT></H3><P>The icon used for a program is created by AppWizard when you initially createthe project. To change this icon, open the image editor by double-clicking the application'sicon in the resource view Icon folder.</P><P>After opening the icon, use the image editor tools to modify the icon as you want.Every application written for Windows can have its icon displayed in large and smallformats. If you edit one of the icon formats, make sure you make corresponding changesin all formats supported by the icon. To display and edit all the available formats,click the drop-down combo box above the image editor, which displays all the supportedformats for the icon. Selecting a new format loads that version of the icon intothe image editor.</P><P>Every child window type also has a unique icon. You can edit that icon just asyou do the program's main icon. As discussed earlier this hour, the child windowicon is named with a shared resource identifier in the form <TT>IDR_MYAPPTYPE</TT>,where the application is named <TT>MyApp</TT>.<H3><FONT COLOR="#000077"><B>Retrieving Icons from Image Lists</B></FONT></H3><P>When an image is stored in an image list, the image list often draws the itemdirectly, using the MFC <TT>CImageList::Draw</TT> member function. However, you alsocan have the image list create an icon based on an individual image. The <TT>CImageList::ExtractIcon</TT>member function is used to create such an icon:</P><PRE><FONT COLOR="#0066FF"><TT>HICON hIcon = m_imageList.ExtractIcon( 2 );</TT></FONT></PRE><P>Using this member function is useful when several icons must be stored together.<H3><FONT COLOR="#000077"><B>Displaying an Icon on a Button</B></FONT></H3><P>Another useful way to use an icon is to display it in a button. Beginning withWindows 95, it's possible to display an icon in a button almost as easily as displayinga text string. Use the <TT>CButton</TT> member function <TT>SetIcon</TT> to set abutton's icon. The icon must be loaded before it is used and destroyed after thebutton is destroyed.<H4><FONT COLOR="#000077">Adding New Icon Resources</FONT></H4><P>For this example, add two buttons to the DCTest About dialog box. These two &quot;stop-light&quot;buttons work just like the traditional OK and Cancel buttons. Figure 14.1 shows the<TT>IDI_RED</TT> icon; although you can't tell from the figure, this icon consistsof a red circle surrounded by the transparent color. Also, create a similar iconnamed <TT>IDI_GREEN</TT>, using a green circle surrounded by the transparent color.</P><P><A NAME="01"></A><A HREF="01.htm"><B>Figure 14.1.</B> </A><BR><I>The new icons used in the DCTest example.</I></P><P>Use the two icons created earlier to label buttons in the DCTest About dialogbox. Modify the <TT>IDD_ABOUT</TT> dialog box by adding an extra button to it, asshown in Figure 14.2.</P><P><A NAME="02"></A><A HREF="02.htm"><B>Figure 14.2.</B> </A><I><BR>The About dialog box used in the Icon example.</I></P><P>Use the values from Table 14.1 to set the attributes for the two buttons in theAbout dialog box. Use ClassWizard to add the two buttons to the <TT>CAboutDlg</TT>class as <TT>CButton</TT> variables.<H4><FONT COLOR="#000077">Table 14.1. Values used for button controls in the DCTestAbout dialog box.</FONT></H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><B>ID</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Variable Name</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Control Type</B></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><B>Attributes</B></TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDOK</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_btnOkay</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">CButton</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Visible, Tabstop, Icon, Default</TD>	</TR>	<TR ALIGN="LEFT" rowspan="1">		<TD ALIGN="LEFT" VALIGN="TOP"><TT>IDCANCEL</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP"><TT>m_btnCancel</TT></TD>		<TD ALIGN="LEFT" VALIGN="TOP">CButton</TD>		<TD ALIGN="LEFT" VALIGN="TOP">Visible, Tabstop, Icon</TD>	</TR></TABLE></P><P>Buttons that have icon labels instead of text must have the Icon attribute set.Review each button's Properties dialog box under the Styles tab and make sure theIcon option is checked.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产a精品视频| 欧美精品第一页| 婷婷成人激情在线网| 欧美激情在线看| 欧美军同video69gay| 成人丝袜视频网| 免费成人深夜小野草| 亚洲精品高清视频在线观看| 精品999久久久| 337p亚洲精品色噜噜狠狠| 99在线热播精品免费| 国产精品1区二区.| 日韩精品亚洲专区| 亚洲综合色区另类av| 国产精品日韩精品欧美在线| 日韩亚洲欧美中文三级| 在线观看日韩一区| 大美女一区二区三区| 精品一区二区免费| 日韩成人午夜电影| 亚洲二区视频在线| 亚洲精品ww久久久久久p站| 国产偷国产偷亚洲高清人白洁| 欧美日韩国产综合一区二区三区| 99久久婷婷国产| 国产一区二区成人久久免费影院 | 国产精品色眯眯| 欧美tickling网站挠脚心| 欧美美女网站色| 欧美日韩国产高清一区二区| 欧洲精品一区二区| 在线中文字幕一区| 在线观看成人小视频| 91年精品国产| 色综合激情久久| 日本韩国欧美一区| 91精彩视频在线| 欧美曰成人黄网| 欧美午夜宅男影院| 欧美色综合网站| 在线观看亚洲a| 欧美美女bb生活片| 4438亚洲最大| 日韩精品一区在线| 久久综合狠狠综合久久综合88| 精品国产精品一区二区夜夜嗨| www国产成人免费观看视频 深夜成人网| 日韩亚洲欧美一区| 精品福利视频一区二区三区| 国产亚洲一二三区| 国产精品国产自产拍高清av王其 | 久久99国产精品久久99| 毛片av一区二区| 激情图片小说一区| 风间由美中文字幕在线看视频国产欧美| 成人免费视频视频| 色综合天天在线| 欧美日韩在线播| 欧美成人一区二区三区片免费 | 欧美少妇性性性| 91麻豆精品国产综合久久久久久| 欧美丰满一区二区免费视频| 日韩精品一区二区三区在线观看 | 久久久亚洲精品石原莉奈| 国产无一区二区| 亚洲综合区在线| 美女脱光内衣内裤视频久久网站| 国产精品一二三区| 日本精品视频一区二区| 欧美一区二区三区日韩视频| 国产亚洲成av人在线观看导航 | 蜜桃免费网站一区二区三区| 国产精品香蕉一区二区三区| 91一区一区三区| 91精品国产综合久久精品图片| 久久综合五月天婷婷伊人| 亚洲免费视频中文字幕| 麻豆久久久久久久| 91偷拍与自偷拍精品| 欧美精品视频www在线观看| 国产色爱av资源综合区| 亚洲精品精品亚洲| 国产乱人伦偷精品视频免下载| va亚洲va日韩不卡在线观看| 制服丝袜在线91| 中文字幕一区二区日韩精品绯色| 亚洲高清免费一级二级三级| 国产精品资源在线看| 欧日韩精品视频| 欧美激情一区二区三区四区| 午夜电影久久久| aaa欧美色吧激情视频| 日韩亚洲欧美综合| 亚洲自拍偷拍麻豆| 国产精品18久久久久| 欧美一区二区三区四区高清 | 亚洲国产wwwccc36天堂| 国产成人无遮挡在线视频| 欧美精品三级日韩久久| 自拍偷拍欧美精品| 国产一区二区精品在线观看| 欧美高清一级片在线| 国产精品短视频| 国产成人自拍网| 欧美电影免费观看高清完整版在线| 一区二区欧美国产| 国产a区久久久| 久久综合色之久久综合| 日韩va亚洲va欧美va久久| 色哟哟一区二区在线观看| 国产精品美日韩| 国产精品99久久久久久宅男| 欧美成人艳星乳罩| 天天色综合成人网| 欧美在线小视频| 国产一区二区三区| 在线不卡中文字幕| 亚洲人成在线播放网站岛国 | 成人丝袜18视频在线观看| 久久综合久色欧美综合狠狠| 蜜臀av性久久久久蜜臀aⅴ| 欧美日韩国产精选| 亚洲午夜电影在线观看| 色哟哟一区二区在线观看| 亚洲视频一区在线观看| 99国产精品久久久久| 国产精品亲子伦对白| 成人av午夜电影| 国产精品麻豆视频| av电影天堂一区二区在线观看| 国产午夜精品一区二区三区嫩草| 久久精品国产一区二区| 欧美福利一区二区| 日韩精品久久理论片| 91精品在线麻豆| 美女网站一区二区| 日韩精品一区二区三区视频 | 精品国产露脸精彩对白| 精品制服美女丁香| 精品久久久久久久久久久久包黑料 | 国产成人自拍网| 中文字幕欧美激情一区| 成人福利视频在线看| 国产午夜精品理论片a级大结局| 国产成人福利片| 国产精品萝li| 欧美曰成人黄网| 首页国产欧美久久| 欧美一级片在线看| 国产综合色产在线精品| 国产精品三级视频| 色av成人天堂桃色av| 日韩成人一级片| 国产亚洲精品aa午夜观看| 不卡的av电影| 亚洲国产一区在线观看| 欧美一级在线免费| 国产麻豆精品久久一二三| 亚洲欧美一区二区在线观看| 91福利国产成人精品照片| 午夜精品福利久久久| 精品国产乱码久久久久久免费| 丰满亚洲少妇av| 亚洲成人综合网站| 日韩美女主播在线视频一区二区三区| 国产尤物一区二区| 亚洲欧美偷拍另类a∨色屁股| 欧美日韩一区三区| 精品系列免费在线观看| 国产精品高潮呻吟| 91精品国产综合久久精品性色| 国产精品一区二区黑丝| 洋洋av久久久久久久一区| 欧美大片国产精品| 91免费小视频| 久久99国产精品尤物| 一区二区三区在线影院| 日韩免费在线观看| gogo大胆日本视频一区| 蜜臀精品久久久久久蜜臀| 国产精品成人免费| 欧美一区二区视频免费观看| 成人av资源站| 久久国产综合精品| 日韩美女久久久| 精品日韩99亚洲| 欧美日韩一区高清| 丰满放荡岳乱妇91ww| 青椒成人免费视频| 亚洲另类色综合网站| 久久亚区不卡日本| 制服丝袜激情欧洲亚洲| 色哟哟国产精品免费观看| 久久超碰97中文字幕| 玉足女爽爽91| 中文字幕不卡在线播放| 日韩一区二区视频在线观看| 色悠久久久久综合欧美99| 国产69精品久久777的优势| 日本vs亚洲vs韩国一区三区二区 |