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

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

?? apc.htm

?? VisualC21天自學教程.rar 英文經典教程
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD>	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1"><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 NAME="GENERATOR" Content="Symantec Visual Page Mac 1.1.1">	<TITLE>Teach Yourself Visual C++ 6 in 21 Days -- Appendix C -- Printing and Print Previewing</TITLE></HEAD><BODY TEXT="#000000" BGCOLOR="#FFFFFF"><H1 ALIGN="CENTER"><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM"BORDER="0"><BR>Teach Yourself Visual C++ 6 in 21 Days</H1><CENTER><P><A HREF="../apb/apb.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../apd/apd.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><H1 ALIGN="CENTER">- C -<BR>Printing and Print Previewing</H1><H1></H1><UL>	<LI><A HREF="#Heading1">Using the Framework's Functionality</A>	<UL>		<LI><A HREF="#Heading2">Using Default Print Functionality</A>		<LI><A HREF="#Heading4">Overriding OnPrint()</A>		<LI><A HREF="#Heading5">Using the Printer Device Context</A>		<LI><A HREF="#Heading6">Maintaining the Aspect Ratio</A>	</UL>	<LI><A HREF="#Heading7">Pagination and Orientation</A>	<UL>		<LI><A HREF="#Heading8">Setting the Start and End Pages</A>		<LI><A HREF="#Heading9">Using the Print Dialog Box</A>		<LI><A HREF="#Heading10">Using Portrait and Landscape Orientations</A>		<LI><A HREF="#Heading11">Adding GDI Objects with OnBeginPrinting()</A>		<LI><A HREF="#Heading12">Customizing Device Context Preparation</A>		<LI><A HREF="#Heading13">Aborting the Print Job</A>	</UL>	<LI><A HREF="#Heading14">Direct Printing Without the Framework</A>	<UL>		<LI><A HREF="#Heading15">Invoking the Print Dialog Box Directly</A>		<LI><A HREF="#Heading16">Using StartDoc() and EndDoc()</A>		<LI><A HREF="#Heading17">Using StartPage() and EndPage()</A>	</UL></UL><P><HR SIZE="4"><BR><I>by Jon Bates</I></P><P><I></I><H2><A NAME="Heading1"></A>Using the Framework's Functionality</H2><P>The SDI and MDI frameworks created by the AppWizard add the hooks for printingand previewing by default. These can be turned off by unchecking the Printing andPrint Preview option in Step 4 of the MFC AppWizard, but generally they are usefulto include in any project and add very little overhead. Most of the real work ofprinting is taken care of by the device context and GDI. The framework presents youwith a device context for a print document page; you can treat it pretty much asif it's a normal window device context.</P><P><H3><A NAME="Heading2"></A>Using Default Print Functionality</H3><P>The SDI (Single Document Interface) framework supports printing images from viewsbased on information held in the document. Because this information is already displayedin your applications views, you can probably print it by modifying the view to addprinting support.</P><P>The framework calls your OnDraw() function in the view to display an image. Thereis a corresponding OnPrint() function that it calls to let your view handle printingthe information. Often this task is simply a case of using the same drawing codeas you've implemented in your OnDraw() function. If this is so, you don't actuallyneed to implement the OnPrint() function; the framework does this by default in theCView base class and calls OnDraw(). The printer is then treated just like it wouldbe for a screen because it offers a device context for the drawing functions to use,as a substitute for the usual screen device context. Your OnDraw() function can determinewhether the device context it is passed is a screen or printer device context, butbecause the drawing functions will work in the same way on both, even this knowledgeisn't necessary.</P><P>You can explore the printing functionality added by the standard framework bycreating a standard SDI application with the AppWizard. Leave the Printing and PrintPreview option in Step 4 checked (this means you can click Finish<B> </B>on Step1) and name the project PrintIt.</P><BLOCKQUOTE>	<P><HR><B>STANDARD PRINT FRAMEWORK SUPPORT</B><BR>	</P>	<P>The standard print and print preview support is available only in SDI and MDI	applications. Dialog box-based applications must implement their own printing support.<HR></BLOCKQUOTE><P>The first thing you'll need is a graphic to print. You can create a graphicaltest display in the OnDraw() function of my CPrintItView class (just a normal CView)as shown in Listing C.1. This test displays a line-art style picture with some centralizedtext in a large font (see Figure C.1). The test image isn't too important, but itwill make a useful comparison between printed output and screen display.</P><P><H4>LISTING C.1.&nbsp;LST23_1.CPP--DRAWING IN OnDraw TO PRODUCE A PRINT SAMPLE.</H4><PRE>1:  void CPrintItView::OnDraw(CDC* pDC)2:  {3:      CPrintItDoc* pDoc = GetDocument();4:      ASSERT_VALID(pDoc);5:6:      // TODO: add draw code for native data here7:8:      // ** Set metric mapping9:      pDC-&gt;SetMapMode(MM_LOMETRIC);10:11:      // ** Declare and create a font 2.2cm high12:      CFont fnBig;13:      fnBig.CreateFont(220,0,0,0,FW_HEAVY,FALSE,FALSE,0,14:          ANSI_CHARSET,OUT_DEFAULT_PRECIS,15:          CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,16:          FF_SWISS+VARIABLE_PITCH,&quot;Arial&quot;);17:18:      //** Select the new font and store the original19:      CFont* pOldFont = pDC-&gt;SelectObject(&amp;fnBig);20:21:      //** Declare a client rectangle22:      CRect rcClient;23:      GetClientRect(&amp;rcClient);24:25:      // ** Convert to logical units26:      pDC-&gt;DPtoLP(&amp;rcClient);27:28:      // ** Set up some drawing variables29:      const int nPoints = 50;30:      int xm = rcClient.Width();31:      int ym = rcClient.Height();32:      double dAspW = xm/(double)nPoints;33:      double dAspH = ym/(double)nPoints;34:35:      // ** Select a black pen36:      CPen* pOldPen = 37:           (CPen*)pDC-&gt;SelectStockObject(BLACK_PEN);38:39:      // ** Draw the lines40:      for(int i=0;i&lt;nPoints;i++)41:      {42:          int xo = (int)(i * dAspW);43:          int yo = (int)(i * dAspH);44:45:          pDC-&gt;MoveTo(xo,0);46:          pDC-&gt;LineTo(xm,yo);47:          pDC-&gt;LineTo(xm-xo,ym);48:          pDC-&gt;LineTo(0,ym-yo);49:          pDC-&gt;LineTo(xo,0);50:      }51:52:      // ** Reselect the old pen53:      pDC-&gt;SelectObject(pOldPen);54:55:      // ** Draw the text on top56:      pDC-&gt;SetTextAlign(TA_CENTER+TA_BASELINE);57:      pDC-&gt;SetBkMode(TRANSPARENT);58:</PRE><PRE>59: // ** Set gray text</PRE><PRE>60:      pDC-&gt;SetTextColor(RGB(64,64,64));61:      pDC-&gt;TextOut(xm/2,ym/2,&quot;Sample Print&quot;);62:63:      // ** Reselect the old font64:      pDC-&gt;SelectObject(pOldFont);65:  }</PRE><P><A HREF="javascript:popUp('23fig01.gif')"><B>FIGURE C.1.</B></A><B> </B><I>Graphicaltest output of PrintIt in a window.a</I></P><P>Although there is a fair bit of code in this OnDraw() function, none of it isunusual. It just draws lines inside the client rectangle and writes some text inthe middle. Notice at line 9, the mapping mode is set to MM_LOMETRIC; this sets thelogical coordinates to tenths of a millimeter.</P><P>A 2.2cm high font is created at line 13 and used to draw the sample text at line61. Lines 40 to 50 draw the arty &quot;peg and string&quot; frame using the clientrectangle coordinates. I'll let you decipher the details; the important thing hereis to investigate the business of printing.</P><P>If you build and run the program after adding these lines to the OnDraw() functionof Listing C.1, you should see a graphical display in your application window, asshown in Figure C.1.</P><P>So the big question is this: What must you do to print this image output? Surprisinglylittle--because the standard framework tries to print this by calling your OnDraw()function and passing the device context for the printer rather than for the window.</P><P>If you click the File<B> </B>menu of the PrintIt application and choose PrintPreview, you'll see a small representation of the image in the top-left corner, althoughthe font is too big for the line drawing. This isn't the framework's fault; it hasdone its best to represent your window, but it was passed the wrong coordinates forthe device context. The problem lies with the GetClientRect()used in line 23.</P><P>Notice that GetClientRect() is a member of the view, not of the device context.This works fine for the window because the device context is the same size as thewindow rectangle. Now you're passing the window rectangle to the printer device context(which is small in comparison) but creating a 2.2cm high font that is always thesame size (because of the mapping mode).</P><P><H3><A NAME="Heading4"></A>Overriding OnPrint()</H3><P>To fix the client rectangle coordinate size problem, you must pass the correctrectangle for the printer rather than the window. Fortunately, the framework callsa virtual function that you can override in your view and use to find all the informationyou need. As you read earlier, this function is named OnPrint() and is analogousto OnDraw(). When drawing in a window, OnDraw() is called; when drawing on a printer,OnPrint() is called. You might be wondering how the drawing code in OnDraw() wasexecuted to print preview the sample graphical display. The default CView implementationof OnPrint() simply calls OnDraw(), passing its printer device context.</P><P>Your OnPrint() doesn't have to call OnDraw(); you can override OnPrint() to makeit draw something entirely different, but many applications must print out what theuser sees. These applications reuse their OnDraw() code with the printer device context.</P><P>To override the OnPrint() virtual function, perform the following steps:</P><P><DL>	<DT></DT>	<DD><B>1. </B>Click the ClassView tab of the Project Workspace view.	<P>	<DT></DT>	<DD><B>2. </B>Click the top plus sign to open the view of the project classes.	<P>	<DT></DT>	<DD><B>3. </B>Right-click the view class to which you want to add the OnPrint() override	(such as CPrintItView in the PrintIt example) to display the context menu.	<P>	<DT></DT>	<DD><B>4. </B>Select the Add Virtual Function option to display the New Virtual Override	dialog box.	<P>	<DT></DT>	<DD><B>5. </B>You should see an OnPrint virtual function in the New Virtual Functions	list.	<P>	<DT></DT>	<DD><B>6. </B>Click the Add and Edit button to start editing the OnPrint() virtual	function.	<P></DL><P>The standard override for OnPrint() looks like this:</P><P><PRE>void CPrintItView::OnPrint(CDC* pDC, CPrintInfo* pInfo){    // TODO: Add your specialized code here     CView::OnPrint(pDC, pInfo);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产高清精品网站| 久久超碰97中文字幕| 91亚洲精品久久久蜜桃网站 | 91老师国产黑色丝袜在线| 国产精品久久久久久久久免费相片| 粉嫩在线一区二区三区视频| 国产精品毛片高清在线完整版| 99国产欧美久久久精品| 亚洲狠狠丁香婷婷综合久久久| 精品视频在线免费观看| 日本欧美一区二区三区| 26uuu久久天堂性欧美| 高清视频一区二区| 亚洲欧美日韩中文播放 | 欧美精品高清视频| 九色综合狠狠综合久久| 国产精品系列在线| 精品视频一区三区九区| 久久成人免费日本黄色| 中文字幕永久在线不卡| 欧美日韩精品系列| 韩国欧美国产一区| 亚洲素人一区二区| 51精品国自产在线| 成人午夜电影久久影院| 亚洲综合视频网| 国产亚洲欧美日韩日本| 色婷婷精品久久二区二区蜜臀av | 91免费观看视频| 石原莉奈一区二区三区在线观看| 精品国产制服丝袜高跟| 91丨九色丨尤物| 蜜桃av一区二区| 亚洲裸体在线观看| 久久综合资源网| 欧美性生活影院| 懂色av噜噜一区二区三区av| 午夜日韩在线电影| 欧美国产精品中文字幕| 3751色影院一区二区三区| 成人午夜短视频| 久久99国内精品| 亚洲国产成人va在线观看天堂| 国产网红主播福利一区二区| 欧美精三区欧美精三区| 99精品视频中文字幕| 国产一区二区在线电影| 亚洲国产va精品久久久不卡综合| 欧美极品美女视频| 日韩欧美综合一区| 欧美男人的天堂一二区| 在线免费观看成人短视频| 国产高清精品网站| 国产一区视频网站| 青青草原综合久久大伊人精品优势| 亚洲精品水蜜桃| 成人免费在线播放视频| 久久精品一区四区| 日韩欧美激情四射| 3751色影院一区二区三区| 色哟哟亚洲精品| av亚洲精华国产精华精华| 国产在线播放一区三区四| 免费在线观看视频一区| 丝袜美腿亚洲综合| 五月婷婷综合网| 亚洲妇熟xx妇色黄| 亚洲第一激情av| 亚洲一区二区偷拍精品| 一区二区三区在线免费视频| 亚洲免费看黄网站| 亚洲精品少妇30p| 一区二区三区四区视频精品免费 | 欧美猛男超大videosgay| 91极品视觉盛宴| 欧美日韩中文字幕精品| 欧美日韩一级二级| 欧美精品在线观看一区二区| 欧美亚洲一区三区| 欧美日韩免费电影| 欧美一区二区不卡视频| 欧美一区二区三区在线| 日韩免费成人网| 精品久久久久久最新网址| 2020国产精品自拍| 欧美激情一区二区三区不卡| 国产精品久久久久久户外露出| 国产精品剧情在线亚洲| 亚洲精品福利视频网站| 日韩精品免费专区| 国产一区在线观看视频| 国产福利不卡视频| eeuss鲁片一区二区三区在线观看| av动漫一区二区| 欧美日韩中文字幕一区| 日韩视频在线一区二区| 欧美精品一区二区三区四区| 国产喷白浆一区二区三区| 综合网在线视频| 亚洲国产精品尤物yw在线观看| 人人狠狠综合久久亚洲| 国产一区在线精品| 91国偷自产一区二区三区观看 | 91在线看国产| 欧美日韩亚洲另类| 精品国产欧美一区二区| 国产精品国产自产拍高清av王其| 亚洲综合色成人| 美国av一区二区| 99国产欧美另类久久久精品| 5566中文字幕一区二区电影| 国产亚洲欧美一区在线观看| 一区二区免费看| 久久精品国产成人一区二区三区| 成人精品小蝌蚪| 欧美久久久久久蜜桃| 国产婷婷精品av在线| 亚洲小说春色综合另类电影| 韩国午夜理伦三级不卡影院| 色综合激情久久| 久久综合久久综合久久综合| 亚洲精品高清视频在线观看| 久久国产精品色| 欧美性色欧美a在线播放| 久久久精品tv| 亚洲大片在线观看| 波多野结衣91| 欧美成人福利视频| 亚洲图片欧美视频| 国产成人精品一区二| 欧美一区二区三区免费观看视频| 国产精品久久免费看| 男人操女人的视频在线观看欧美| 色综合天天综合狠狠| 国产日韩欧美一区二区三区乱码| 亚洲线精品一区二区三区 | 精品制服美女丁香| 欧美最猛性xxxxx直播| 欧美激情一区二区在线| 六月婷婷色综合| 欧美日韩一区二区三区在线看| 亚洲国产经典视频| 国产九九视频一区二区三区| 欧美一级电影网站| 首页国产欧美日韩丝袜| 91久久国产最好的精华液| 国产精品欧美极品| 国产精品白丝av| 久久婷婷一区二区三区| 日韩高清在线一区| 678五月天丁香亚洲综合网| 亚洲一区二三区| 在线观看国产精品网站| 中文字幕在线不卡一区| 成人免费看的视频| 中文字幕不卡三区| 高清免费成人av| 国产女人水真多18毛片18精品视频 | 成人97人人超碰人人99| 欧美国产综合色视频| 国产aⅴ综合色| 中文字幕 久热精品 视频在线| 国产成人午夜精品5599| 国产午夜精品一区二区三区视频| 激情五月婷婷综合| 久久午夜老司机| 风间由美一区二区三区在线观看 | 欧美在线观看视频一区二区| 亚洲激情六月丁香| 91麻豆国产香蕉久久精品| 成人欧美一区二区三区视频网页| 99久久国产综合精品色伊| 自拍偷拍国产精品| 日本道色综合久久| 亚洲国产aⅴ天堂久久| 欧美一区二视频| 老汉av免费一区二区三区| 久久久久久毛片| 99久久精品国产网站| 一区二区久久久久| 欧美日韩一区二区欧美激情| 日韩精品久久理论片| 26uuu另类欧美| 成人av网址在线| 亚洲一二三区不卡| 精品欧美久久久| 国产成人免费视| 亚洲一二三区不卡| 精品久久国产97色综合| 成人丝袜视频网| 亚洲一区二区三区中文字幕在线| 制服丝袜亚洲色图| 国产麻豆成人精品| 一区二区三区在线免费观看| 91精品欧美综合在线观看最新 | 久久这里只有精品6| 99九九99九九九视频精品| 日韩在线一区二区三区| 26uuu国产一区二区三区| 91亚洲精华国产精华精华液|