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

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

?? ch21.htm

?? 24小時精通VC
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<H4><FONT COLOR="#000077">TYPE: Listing 21.7. Printing a header and text using theOnPrint function.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>void CMFCPrintView::OnPrint(CDC* pDC, CPrintInfo* pInfo)</TT><TT>{</TT><TT>    CPoint      pt( 5000, -7000 );</TT><TT>    TEXTMETRIC  tm;</TT><TT>    //Since the DC has been modified, it's always a good idea to reset</TT><TT>    //the mapping mode, no matter which one you use. In our case, since</TT><TT>    //we use MM_TWIPS, we have to reset the mapping mode for each page.</TT><TT>    pDC-&gt;SetMapMode( MM_TWIPS );</TT><TT>    PrintHeader( pDC );</TT><TT>    CFont* pOldFont = pDC-&gt;SelectObject( m_pFntBold );</TT><TT>    pDC-&gt;GetTextMetrics( &amp;tm );</TT><TT>    int cyText = tm.tmHeight + tm.tmExternalLeading;</TT><TT>    m_nCurrentPrintedPage++;</TT><TT>    pDC-&gt;TextOut( pt.x, pt.y, &quot;Hello Printer!!!&quot; );</TT><TT>    pt.y += cyText;</TT><TT>    CString  szPageInfo;</TT><TT>    szPageInfo.Format( TEXT(&quot;Page number %d&quot;),</TT><TT>                       m_nCurrentPrintedPage );</TT><TT>    pDC-&gt;TextOut( pt.x, pt.y, szPageInfo );</TT><TT>    pDC-&gt;SelectObject( pOldFont );</TT><TT>    PrintFooter( pDC );</TT><TT>}</TT> </FONT></PRE><P>Listing 21.8 provides the source code used to print the header and footer. Addthese two functions to the <TT>MFCPrintView.cpp</TT> source file.<H4><FONT COLOR="#000077">TYPE: Listing 21.8. Printing the header and footer.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>void CMFCPrintView::PrintFooter( CDC* pDC )</TT><TT>{</TT><TT>    ASSERT( pDC );</TT><TT>    TEXTMETRIC  tm;</TT><TT>    CPoint  pt( 0, -14400 );</TT><TT>    //Select the smaller font used for the file name.</TT><TT>    ASSERT( m_pFntHighlight );</TT><TT>    CFont* pOldFont = pDC-&gt;SelectObject( m_pFntHighlight );</TT><TT>    ASSERT( pOldFont );</TT><TT>    pDC-&gt;GetTextMetrics( &amp;tm );</TT><TT>    int cyText = tm.tmHeight + tm.tmExternalLeading;</TT><TT>    // Print the underline bar. This is the same pen used to draw</TT><TT>    // black lines in the control. 10000 twips is about 7 inches or so.</TT><TT>    CPen* pOldPen = pDC-&gt;SelectObject( &amp;m_penBlack );</TT><TT>    ASSERT( pOldPen );</TT><TT>    pt.y -= (cyText / 2);</TT><TT>    pDC-&gt;MoveTo( pt );</TT><TT>    pDC-&gt;LineTo( 10000, pt.y );</TT><TT>    pt.y -= cyText;</TT><TT>    pDC-&gt;TextOut( pt.x, pt.y, TEXT(&quot;Every page needs a footer&quot;) );</TT><TT>    // Restore GDI objects.</TT><TT>    pDC-&gt;SelectObject( pOldFont );</TT><TT>    pDC-&gt;SelectObject( pOldPen );</TT><TT>}</TT><TT>void CMFCPrintView::PrintHeader( CDC* pDC )</TT><TT>{</TT><TT>    ASSERT( pDC );</TT><TT>    TEXTMETRIC  tm;</TT><TT>    CPoint      pt( 0, 0 );</TT><TT>    // Select the banner font, and print the headline.</TT><TT>    CFont* pOldFont = pDC-&gt;SelectObject( m_pFntBanner );</TT><TT>    ASSERT( pOldFont );</TT><TT>    pDC-&gt;GetTextMetrics( &amp;tm );</TT><TT>    int cyText = tm.tmHeight + tm.tmExternalLeading;</TT><TT>    pt.y -= cyText;</TT><TT>    pDC-&gt;TextOut( pt.x, pt.y, &quot; Teach Yourself Visual C++ in 24 Hours&quot; );</TT><TT>    // Move down one line, and print and underline bar. This is the same</TT><TT>    // pen used to draw black lines in the control. 10000 twips is about</TT><TT>    // 7 inches or so.</TT><TT>    CPen* pOldPen = pDC-&gt;SelectObject( &amp;m_penBlack );</TT><TT>    ASSERT( pOldPen );</TT><TT>    pt.y -= cyText;</TT><TT>    pDC-&gt;MoveTo( pt );</TT><TT>    pDC-&gt;LineTo( 10000, pt.y );</TT><TT>    // We move down about 1/2 line, and print the report type using the</TT><TT>    // smaller font.</TT><TT>    VERIFY( pDC-&gt;SelectObject( m_pFntHighlight ) );</TT><TT>    pDC-&gt;GetTextMetrics( &amp;tm );</TT><TT>    cyText = tm.tmHeight + tm.tmExternalLeading;</TT><TT>    pt.y -= (cyText / 2);</TT><TT>    pDC-&gt;TextOut( pt.x, pt.y, &quot;Printing Demonstration&quot; );</TT><TT>    // Restore GDI objects.</TT><TT>    pDC-&gt;SelectObject( pOldFont );</TT><TT>    pDC-&gt;SelectObject( pOldPen );</TT><TT>}</TT></FONT></PRE><H3><FONT COLOR="#000077"><B>Using the <TT>OnEndPrinting</TT> Function to ReleaseResources</B></FONT></H3><P>The <TT>OnEndPrinting</TT> function is called once per print job, but only ifthe <TT>OnBeginPrinting</TT> function has been called. Use this function to releasethe resources allocated in <TT>OnBeginPrinting</TT>.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>CAUTION:</B></FONT><B> </B>You must match all of	your allocations made in <TT>OnBeginPrinting</TT> with deallocations in <TT>OnEndPrinting</TT>.	If you don't, you will get a memory or resource leak. <HR></BLOCKQUOTE><P>Listing 21.9 provides the source code for the <TT>OnEndPrinting</TT> functionused in <TT>MFCPrintView</TT>. As in the <TT>OnBeginPrinting</TT> function presentedin Listing 21.5, AppWizard comments out the <TT>pDC</TT> and <TT>pInfo</TT> parameters.If you use these parameters, you must remove the comments.<H4><FONT COLOR="#000077">TYPE: Listing 21.9. Releasing resources in the OnEndPrintingfunction.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>void CMFCPrintView::OnEndPrinting(CDC* pDC, CPrintInfo* pInfo)</TT><TT>{</TT><TT>    delete m_pFntBold;</TT><TT>    delete m_pFntBanner;</TT><TT>    delete m_pFntHighlight;</TT><TT>    // Since the destructor also deletes these fonts, we have</TT><TT>    // to set pointers to 0 to avoid dangling pointers and exceptions</TT><TT>    // generated by invoking delete on a non-valid pointer.</TT><TT>    m_pFntBold = 0;</TT><TT>    m_pFntBanner = 0;</TT><TT>    m_pFntHighlight = 0;</TT><TT>    CView::OnEndPrinting(pDC, pInfo);</TT><TT>}</TT> </FONT></PRE><P>Compile and run the Print project, and send the output to the printer using eitherthe File menu or the toolbar icon. Send the sample printout pages to the printer.<H2><FONT COLOR="#000077"><B>Summary</B></FONT></H2><P>In this hour you learned about the print functions and support offered by MFCand the Document/View architecture. You also created a small sample program thatsent three pages of text to the printer.<H2><FONT COLOR="#000077"><B>Q&amp;A</B></FONT></H2><DL>	<DD><B>Q How can I draw graphics such as rectangles and ellipses on my printouts?</B><BR>	<BR>	<B>A</B> The same way that you draw them to the screen--you can use all the basic	GDI functions when printing; this includes <TT>Ellipse</TT> and <TT>Rectangle</TT>.<BR>	<BR>	<B>Q How can I change my printout to have landscape instead of portrait orientation?</B><BR>	<BR>	<B>A</B> To change the page orientation to landscape, you must change a printing	attribute attached to the device context. Due to minor differences in the way in	which Windows 95 and Windows NT handle printing details, this must be done for each	page during the <TT>OnPrepareDC</TT> function. Add the following code at the top	of <TT>CMFCPrintView::OnPrepareDC</TT>:</DL><BLOCKQUOTE>	<PRE><FONT COLOR="#0066FF"><TT>if(pDC-&gt;IsPrinting())</TT><TT>{</TT><TT>    LPDEVMODE  pDevMode;</TT><TT>    pDevMode = pInfo-&gt;m_pPD-&gt;GetDevMode();</TT><TT>    pDevMode-&gt;dmOrientation = DMORIENT_LANDSCAPE;</TT><TT>    pDC-&gt;ResetDC(pDevMode);</TT><TT>}</TT></FONT></PRE></BLOCKQUOTE><PRE><FONT COLOR="#0066FF"><TT></TT></FONT></PRE><H2><FONT COLOR="#000077"><B>Workshop</B></FONT></H2><P>The Workshop is designed to help you anticipate possible questions, review whatyou've learned, and begin thinking ahead to putting your knowledge into practice.The answers to the quiz are in Appendix B, &quot;Quiz Answers.&quot;<H3><FONT COLOR="#000077"><B>Quiz</B></FONT></H3><DL>	<DD>1. How can you determine whether a printer supports <TT>BitBlt</TT> operations?<BR>	<BR>	2. What are the five MFC view functions that are most commonly overridden for printing?<BR>	<BR>	3. Which MFC view functions are called once for every printed page, and which functions	are called once per print job?<BR>	<BR>	4. What class is used to store information about the state of a print job?<BR>	<BR>	5. Which view function is used to allocate resources used to render the printout?<BR>	<BR>	6. Approximately how many twips are in an inch?<BR>	<BR>	7. What <TT>CPrintInfo</TT> member variable must be set for multiple page printouts?<BR>	<BR>	8. When using the <TT>MM_TWIPS</TT> mapping mode, which direction is positive: up	or down?<BR>	<BR>	9. When using the <TT>MM_TWIPS</TT> mapping mode, which direction is positive: left	or right?<BR>	<BR>	10. Which MFC view function should be used to release resources allocated for printing?</DL><H3><FONT COLOR="#000077"><B>Exercises</B></FONT></H3><DL>	<DD>1. Modify the MFCPrint project so that it prints the page number at the foot	of each page.<BR>	<BR>	2. Modify the MFCPrint project so that it prints the time printed at the top of each	page.<FONT COLOR="#000077"></FONT></DL><CENTER><P><HR><A HREF="../ch20/ch20.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch22/ch22.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> <BR><BR><BR><IMG SRC="../button/corp.gif" WIDTH="284" HEIGHT="45" ALIGN="BOTTOM" ALT="Macmillan Computer Publishing USA"BORDER="0"></P><P>&copy; <A HREF="../copy.htm">Copyright</A>, Macmillan Computer Publishing. Allrights reserved.</CENTER></BODY></HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲精品超碰| 日韩写真欧美这视频| 欧美亚洲一区二区在线观看| 色就色 综合激情| 91精品国产综合久久福利| 欧美美女黄视频| 欧美成人在线直播| 亚洲欧洲成人av每日更新| 亚洲va欧美va人人爽| 久久精品国产**网站演员| 国产成人av电影在线| 欧美主播一区二区三区| 欧美精品一区二区三区很污很色的| 久久久美女毛片| 亚洲高清免费视频| 成人黄色大片在线观看| 欧美一区二区三区四区久久| 国产精品视频一二三区| 美女视频一区在线观看| 欧美最猛性xxxxx直播| 国产精品网曝门| 国产一区二区三区在线看麻豆| 在线视频一区二区三| 久久精品综合网| 裸体歌舞表演一区二区| 欧美日韩一区三区| 亚洲乱码国产乱码精品精的特点| 成人禁用看黄a在线| 久久影视一区二区| 久久电影网站中文字幕| 日韩欧美二区三区| 美女www一区二区| 久久综合网色—综合色88| 爽爽淫人综合网网站| 在线成人免费视频| 免费一级欧美片在线观看| 欧美日韩一二区| 日本欧美在线观看| 精品国精品国产| 成人免费观看视频| 亚洲天堂中文字幕| 欧美色大人视频| 美女网站一区二区| 中文字幕乱码亚洲精品一区| 91老师片黄在线观看| 亚洲已满18点击进入久久| 欧美日韩国产免费一区二区 | av午夜一区麻豆| 亚洲一级二级三级在线免费观看| 欧美一区二区三区播放老司机| 国内精品国产三级国产a久久| 久久久蜜臀国产一区二区| 在线观看国产日韩| 麻豆高清免费国产一区| 国产三级一区二区| 91精品免费在线观看| 色综合天天综合| 国产一区二区不卡| 亚洲成人777| 中文字幕人成不卡一区| 欧美变态tickling挠脚心| 欧美色综合天天久久综合精品| 国产成人综合亚洲网站| 奇米影视在线99精品| 亚洲一区二区三区中文字幕在线| 久久久久久久免费视频了| 337p亚洲精品色噜噜噜| 91视频免费观看| 99天天综合性| av欧美精品.com| 国产成人免费视频网站| 国产一区中文字幕| 久久福利资源站| 久久成人久久鬼色| 久久精品国产99| 韩国三级电影一区二区| 另类小说视频一区二区| 麻豆精品在线观看| 久久国产生活片100| 免费一级片91| 国产在线观看一区二区| 国产成人综合网| 97久久精品人人做人人爽50路 | 日韩亚洲欧美在线| 精品精品欲导航| 国产欧美一区二区三区鸳鸯浴| 久久综合色之久久综合| 久久免费视频色| 亚洲免费伊人电影| 亚洲综合男人的天堂| 日本亚洲电影天堂| 国内精品伊人久久久久av一坑 | 日韩欧美国产成人一区二区| 久久综合久久综合九色| 国产精品久久久久影院| 夜夜嗨av一区二区三区四季av | 欧美自拍偷拍午夜视频| 欧美一级日韩一级| 成人欧美一区二区三区1314| 亚洲一区二区3| 国产伦精一区二区三区| 91久久精品午夜一区二区| 日韩三级在线免费观看| 国产精品乱码人人做人人爱| 一个色综合av| 不卡av免费在线观看| 欧美tickling网站挠脚心| 自拍偷在线精品自拍偷无码专区| 免费看黄色91| 欧美色偷偷大香| 亚洲欧美偷拍卡通变态| 国产一区二区三区综合| 欧美日韩视频专区在线播放| 一区二区三区四区乱视频| 国内精品久久久久影院薰衣草| 欧洲一区在线观看| 国产精品每日更新| a亚洲天堂av| 国产亚洲一区二区三区在线观看| 成人综合婷婷国产精品久久蜜臀 | 国模冰冰炮一区二区| 69堂国产成人免费视频| 亚洲午夜av在线| 91激情五月电影| 亚洲一区二区三区四区的| 91首页免费视频| 亚洲宅男天堂在线观看无病毒| av中文字幕不卡| 亚洲欧美色综合| 91福利在线免费观看| 亚洲国产精品久久久久婷婷884 | 一区二区三区视频在线观看 | 国产精品麻豆网站| 色偷偷久久一区二区三区| 亚洲欧美偷拍三级| 91精品国产欧美日韩| 另类成人小视频在线| 欧美国产丝袜视频| 色天使色偷偷av一区二区| 日韩成人免费电影| 欧美激情一区二区三区蜜桃视频| 99久久国产综合精品色伊| 五月天婷婷综合| 1区2区3区精品视频| 日韩你懂的在线播放| 国产尤物一区二区| 中文字幕欧美一| 日韩欧美一二三区| 日本韩国精品在线| 国产一区二区三区免费观看| 亚洲精品一二三区| 久久久国产精华| 欧美一级视频精品观看| 色婷婷综合激情| 欧美人妖巨大在线| 在线精品视频免费观看| 成人一区二区三区视频| 美女性感视频久久| 午夜激情综合网| 亚洲综合一二三区| 亚洲欧洲成人自拍| 国产精品情趣视频| 欧美激情一区二区在线| www国产成人免费观看视频 深夜成人网 | 老色鬼精品视频在线观看播放| 一区二区三区中文在线| ㊣最新国产の精品bt伙计久久| 欧美国产精品中文字幕| 国产人妖乱国产精品人妖| 久久久精品tv| 国产精品久久午夜| 国产精品久久久久天堂| 国产精品三级视频| 国产精品夫妻自拍| 一区二区高清视频在线观看| 亚洲精品欧美在线| 免费高清在线视频一区·| 国产一区二区免费视频| 高清久久久久久| av中文字幕不卡| 欧美日韩一区二区三区免费看 | 亚洲第一搞黄网站| 美女一区二区三区| 粉嫩aⅴ一区二区三区四区 | 国产精品久久久久久亚洲毛片| 亚洲三级电影网站| 奇米888四色在线精品| 国产精品综合久久| 欧美少妇bbb| 国产女人18水真多18精品一级做| 有坂深雪av一区二区精品| 日本亚洲三级在线| jvid福利写真一区二区三区| 欧美三级日本三级少妇99| 精品国产乱码久久| 亚洲一区成人在线| 成人精品免费网站| 日韩午夜精品电影| 亚洲动漫第一页| 9人人澡人人爽人人精品|