亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产亚洲精品资源在线26u| 亚洲黄色性网站| ...av二区三区久久精品| 午夜欧美在线一二页| 成人激情图片网| 日韩欧美视频一区| 亚洲六月丁香色婷婷综合久久 | 蜜桃视频在线观看一区| 99国内精品久久| 久久久精品免费网站| 日韩av不卡一区二区| 色先锋资源久久综合| 中文字幕av资源一区| 麻豆一区二区三区| 日韩一区二区三| 午夜久久久久久久久久一区二区| 国产成人aaa| 久久综合九色综合97_久久久| 久久久久久久久久久久电影| 艳妇臀荡乳欲伦亚洲一区| 国产美女在线观看一区| 欧美在线影院一区二区| 国产精品久久久久久久岛一牛影视| 天堂蜜桃一区二区三区| 色天使久久综合网天天| 国产免费观看久久| 蜜臀av性久久久久蜜臀aⅴ四虎| 91日韩精品一区| 国产女人18水真多18精品一级做| 日本vs亚洲vs韩国一区三区 | 日本美女一区二区| 在线视频欧美精品| 亚洲四区在线观看| 成人va在线观看| 久久久精品免费观看| 久草精品在线观看| 91精品国产综合久久久久久久久久| 中文字幕在线不卡一区二区三区| 国内精品伊人久久久久av一坑 | 久久国产精品色| 欧美偷拍一区二区| 夜夜夜精品看看| 91丨porny丨国产| 欧美激情中文字幕一区二区| 国产老妇另类xxxxx| 精品国产伦一区二区三区观看体验| 天堂一区二区在线| 欧美日韩高清在线播放| 亚洲精品自拍动漫在线| 91丨porny丨蝌蚪视频| 国产精品成人在线观看| 99国产精品国产精品毛片| 国产精品免费免费| av欧美精品.com| 最新国产成人在线观看| 在线视频你懂得一区| 亚洲成人激情自拍| 欧美美女网站色| 奇米精品一区二区三区在线观看一| 7777精品伊人久久久大香线蕉 | 一区二区三区久久| 欧美日韩一区高清| 日韩专区在线视频| 精品乱码亚洲一区二区不卡| 狠狠色伊人亚洲综合成人| 精品久久久久久久久久久院品网| 国产一区二区成人久久免费影院 | 国产一区不卡在线| 国产精品久久久久久久午夜片| 91免费版在线看| 亚洲国产成人高清精品| 欧美大片拔萝卜| 99久久精品国产观看| 亚洲成av人片在www色猫咪| 日韩欧美国产综合一区| 国产成人午夜99999| 亚洲精品综合在线| 91精品国产综合久久久久久久| 国产最新精品免费| 一区二区三区精品久久久| 日韩视频中午一区| 99久久精品免费观看| 蜜桃视频一区二区| 国产精品久久久久久亚洲毛片| 精品视频一区三区九区| 国产精品一区一区| 亚欧色一区w666天堂| 国产日韩欧美综合一区| 成人av免费在线| 日韩精品电影一区亚洲| 国产精品久久久久影院老司| 欧美少妇bbb| 国产一区三区三区| 亚洲同性gay激情无套| 91麻豆精品国产91| 国产sm精品调教视频网站| ...xxx性欧美| 91精品国产品国语在线不卡 | 久久婷婷国产综合国色天香| av电影天堂一区二区在线观看| 亚洲www啪成人一区二区麻豆| 精品国产伦一区二区三区免费| av在线免费不卡| 美女爽到高潮91| 亚洲综合色区另类av| 欧美成人欧美edvon| 欧美精品在线视频| 国模娜娜一区二区三区| 首页综合国产亚洲丝袜| 中文字幕一区二区三区四区| 欧美成人性福生活免费看| 欧美日韩精品一区二区天天拍小说 | 日本不卡一区二区三区| 尤物视频一区二区| 中文字幕一区日韩精品欧美| 国产亚洲污的网站| 26uuu精品一区二区| 欧美一区二区三区在线观看| 欧美日韩中文精品| 91传媒视频在线播放| 91女人视频在线观看| 99久久综合狠狠综合久久| 国产成人综合网| 国产一区在线不卡| 国产曰批免费观看久久久| 蜜臀av性久久久久蜜臀av麻豆| 午夜视黄欧洲亚洲| 五月天中文字幕一区二区| 亚洲一区二区美女| 亚洲伊人色欲综合网| 亚洲精品欧美专区| 洋洋av久久久久久久一区| 一区二区三区四区在线| 亚洲精品中文字幕在线观看| 一区二区三区中文字幕精品精品| 国产精品成人一区二区艾草| 亚洲欧洲另类国产综合| 久久久久久久久免费| 中文字幕精品一区二区精品绿巨人| 久久久久久97三级| 亚洲国产经典视频| 综合久久久久久| 一区二区三区不卡视频在线观看| 亚洲一二三区在线观看| 午夜伊人狠狠久久| 久久99久久99精品免视看婷婷| 久久精品国产亚洲aⅴ| 国产成人精品影视| 99九九99九九九视频精品| 一本一道综合狠狠老| 欧美日韩免费在线视频| 欧美一区二区视频观看视频| 久久综合狠狠综合| 国产精品成人免费| 午夜私人影院久久久久| 久久99国产精品尤物| 国产精品一区二区91| 91麻豆文化传媒在线观看| 欧美色图第一页| 久久久久亚洲综合| 亚洲色欲色欲www| 日韩主播视频在线| 韩国精品主播一区二区在线观看 | 成人免费的视频| 91蜜桃在线免费视频| 3751色影院一区二区三区| 久久综合成人精品亚洲另类欧美| 久久免费电影网| 一区二区三区四区精品在线视频| 亚洲高清免费一级二级三级| 久久草av在线| 91麻豆.com| 欧美一区二区在线看| 亚洲视频一二三| 午夜久久久久久久久| 福利一区二区在线| 911精品产国品一二三产区| 久久精品人人爽人人爽| 香蕉成人伊视频在线观看| 高清国产一区二区| 日韩一区二区不卡| 一区二区三区日韩精品视频| 国产在线精品免费av| 欧美日韩亚洲不卡| 中文字幕日韩一区| 韩国一区二区在线观看| 精品视频1区2区| 最新久久zyz资源站| 国产一区二区三区四区五区入口| 欧美性视频一区二区三区| 欧美国产欧美综合| 欧美96一区二区免费视频| 91久久线看在观草草青青| 久久精品人人做人人爽97| 美腿丝袜亚洲一区| 欧美色精品天天在线观看视频| 亚洲欧洲国产专区| 国产精品一色哟哟哟| 337p日本欧洲亚洲大胆色噜噜| 亚洲精品综合在线|