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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ch21.htm

?? 24小時(shí)精通VC
?? HTM
?? 第 1 頁 / 共 3 頁
字號(hào):
<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Time Saver:</B></FONT><B> </B>By default, only one	page will be printed unless you override this function and set <TT>m_bContinuePrinting</TT>	to <TT>TRUE</TT>. <HR></BLOCKQUOTE><H3><FONT COLOR="#000077"><B>Using the <TT>OnPrint</TT> Function</B></FONT></H3><P>The <TT>OnPrint</TT> function is the printing counterpart to <TT>OnDraw</TT>.In fact, many programs can just use the default version of <TT>OnPrint</TT>, whichcalls <TT>OnDraw</TT>. However, most printouts can benefit from providing page numbers,headers, footers, or special fonts that aren't displayed in the view.</P><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>A <I>twip</I> is one-twentiethof a point. A <I>point</I>, in turn, is almost exactly 1/72 of an inch. This worksout to about 1,440 twips per inch.</P><P>When printing, the <TT>MM_TWIPS</TT> mapping mode is used. The really odd thingabout <TT>MM_TWIPS</TT> is that the mapping mode begins with the upper-left cornerat (0,0) and runs in a negative direction down the page, making the point one inchbelow the origin (0,-1440). Like other modes, the mapping mode extends in a positivedirection to the right side of the page.</P><P>The <TT>OnPrint</TT> function is called once for every page. If you're printingdata that is arranged so that the page number can easily be determined, it's a goodidea to use the <TT>CPrintInfo</TT> parameter to determine the current page number.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>Remember, the user	might ask for a range of pages to be printed, not just the entire document. <HR></BLOCKQUOTE><H3><FONT COLOR="#000077"><B>Using the <TT>OnEndPrinting</TT> Function</B></FONT></H3><P>The <TT>OnEndPrinting</TT> function is called after the printout is finished.This function can be called because the job was completed successfully or becauseit has failed; you don't really know. The purpose of this function is to releaseany resources that were allocated in the <TT>OnBeginPrinting</TT> function.<H3><FONT COLOR="#000077"><B>Querying the Printing Device Context</B></FONT></H3><P>Unlike video displays, printing devices offer a wide variation in their capabilities.It's a good idea to examine the capabilities of a printout device before attemptinggraphics functions.</P><P>As shown in Listing 21.3, you can use the <TT>CDC::GetDeviceCaps</TT> functionto retrieve information about a selected output device.<H4><FONT COLOR="#000077">TYPE: Listing 21.3. Using GetDeviceCaps to determine whetherBitBlt is supported.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>int nRasterFlags = pDC-&gt;GetDeviceCaps(RASTERCAPS);</TT><TT>if(nRasterCaps &amp; RC_BITBLT)</TT><TT>{</TT><TT>    // BitBlt is allowed</TT><TT>}</TT><TT>else</TT><TT>{</TT><TT>    // BitBlt is not allowed</TT></FONT></PRE><P><TT>}</TT> <TT>GetDeviceCaps</TT> accepts an index as a parameter. This indexspecifies the type of information returned from the function. In Listing 21.2, the<TT>RASTERCAPS</TT> index results in a return value that contains flags which indicatethe raster capabilities of the device. If the <TT>RC_BITBLT</TT> flag is set, the<TT>BitBlt</TT> function can be applied to that device.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Time Saver:</B></FONT><B> </B>You can use this function	for any type of device--not just printers. This function can be used to return all	types of information. Check the online documentation for details. <HR></BLOCKQUOTE><H2><FONT COLOR="#000077"><B>Adding More Functionality to MFCPrint</B></FONT></H2><P>The remaining part of this hour is used to add printing functionality to the MFCPrintexample, using the functions discussed in the earlier sections. The <TT>OnPreparePrinting</TT>function supplied by AppWizard isn't changed for this example.<H3><FONT COLOR="#000077"><B>The <TT>CMFCPrintView</TT> Constructor and Destructor</B></FONT></H3><P>The member variables added to the <TT>CMFCPrintView</TT> class must be initializedin the <TT>CMFCPrintView</TT> constructor, and any allocated resources must be releasedin the destructor. The source code for the constructor and destructor is providedin Listing 21.4.<H4><FONT COLOR="#000077">TYPE: Listing 21.4. The constructor and destructor forCMFCPrintView.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>CMFCPrintView::CMFCPrintView()</TT><TT>{</TT><TT>    COLORREF clrBlack = GetSysColor(COLOR_WINDOWFRAME);</TT><TT>    m_penBlack.CreatePen(PS_SOLID, 0, clrBlack);</TT><TT>    m_pFntBold = 0;</TT><TT>    m_pFntBanner = 0;</TT><TT>    m_pFntHighlight = 0;</TT><TT>}</TT><TT>CMFCPrintView::~CMFCPrintView()</TT><TT>{</TT><TT>    // The fonts must be released explicitly</TT><TT>    // since they were created with new.</TT><TT>    delete m_pFntBold;</TT><TT>    delete m_pFntBanner;</TT><TT>    delete m_pFntHighlight;</TT></FONT></PRE><P><TT>}</TT> The usual practice with GDI objects is to defer actually creating theobject until it is needed. The constructor for <TT>CMFCPrintView</TT> sets each ofthe <TT>CFont</TT> pointer variables to <TT>0</TT>; these objects are created onthe heap when the print job begins.</P><P>The destructor for <TT>CMFCPrintView</TT> deletes the dynamically allocated <TT>CFont</TT>objects. Under normal execution, these pointers do not need to be freed because resourcesare released at the end of a print job. However, this code protects you in case ofabnormal program termination, and because it is always safe to delete a pointer to<TT>NULL</TT>, no harm will come to your program in the normal case.<H3><FONT COLOR="#000077"><B>Allocating Resources in the <TT>OnBeginPrinting</TT>Function</B></FONT></H3><P>As you learned earlier, the <TT>OnBeginPrinting</TT> function is called just beforeprinting begins. Add the source code provided in Listing 21.5 to the <TT>OnBeginPrinting</TT>function. This version of <TT>OnBeginPrinting</TT> creates three new fonts that areused in the printout. (You learned about creating fonts in Hour 13, &quot;Fonts.&quot;)<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>To prevent compiler	warnings about unused variables, AppWizard comments out the <TT>pDC</TT> and <TT>pInfo</TT>	parameters. If you use these parameters, you must remove the comments, as shown in	Listing 21.5. <HR></BLOCKQUOTE><H4><FONT COLOR="#000077">TYPE: Listing 21.5. Allocating new fonts in the OnBeginPrintingfunction.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>void CMFCPrintView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)</TT><TT>{</TT><TT>    ASSERT( m_pFntBold == 0 );</TT><TT>    ASSERT( m_pFntBanner == 0 );</TT><TT>    ASSERT( m_pFntHighlight == 0 );</TT><TT>    m_nCurrentPrintedPage = 0;</TT><TT>    pDC-&gt;SetMapMode( MM_TWIPS );</TT><TT>    // Create the bold font used for the fields. TimesRoman,</TT><TT>    // 12 point semi-bold is used.</TT><TT>    m_pFntBold = new CFont;</TT><TT>    ASSERT( m_pFntBold );</TT><TT>    m_pFntBold-&gt;CreateFont( -240,</TT><TT>                            0,</TT><TT>                            0,</TT><TT>                            0,</TT><TT>                            FW_SEMIBOLD,</TT><TT>                            FALSE,</TT><TT>                            FALSE,</TT><TT>                            0,</TT><TT>                            ANSI_CHARSET,</TT><TT>                            OUT_TT_PRECIS,</TT><TT>                            CLIP_DEFAULT_PRECIS,</TT><TT>                            DEFAULT_QUALITY,</TT><TT>                            DEFAULT_PITCH | FF_ROMAN,</TT><TT>                            &quot;Times Roman&quot; );</TT><TT>    // Create the normal font used for the Headline banner.</TT><TT>    // TimesRoman, 18 point italic is used.</TT><TT>    m_pFntBanner = new CFont;</TT><TT>    ASSERT( m_pFntBanner );</TT><TT>    m_pFntBanner-&gt;CreateFont( -360,</TT><TT>                              0,</TT><TT>                              0,</TT><TT>                              0,</TT><TT>                              FW_NORMAL,</TT><TT>                              TRUE,</TT><TT>                              FALSE,</TT><TT>                              0,</TT><TT>                              ANSI_CHARSET,</TT><TT>                              OUT_TT_PRECIS,</TT><TT>                              CLIP_DEFAULT_PRECIS,</TT><TT>                              DEFAULT_QUALITY,</TT><TT>                              DEFAULT_PITCH | FF_ROMAN,</TT><TT>                              &quot;Times Roman&quot; );</TT><TT>    // Create the normal font used for the Headline highlight.</TT><TT>    // This is the text used under the headline banner, and in</TT><TT>    // the footer. TimesRoman, 8 point is used.</TT><TT>    m_pFntHighlight = new CFont;</TT><TT>    ASSERT( m_pFntHighlight );</TT><TT>    m_pFntHighlight-&gt;CreateFont( -160,</TT><TT>                                 0,</TT><TT>                                 0,</TT><TT>                                 0,</TT><TT>                                 FW_NORMAL,</TT><TT>                                 TRUE,</TT><TT>                                 FALSE,</TT><TT>                                 0,</TT><TT>                                 ANSI_CHARSET,</TT><TT>                                 OUT_TT_PRECIS,</TT><TT>                                 CLIP_DEFAULT_PRECIS,</TT><TT>                                 DEFAULT_QUALITY,</TT><TT>                                 DEFAULT_PITCH | FF_ROMAN,</TT><TT>                                 &quot;Times Roman&quot; );</TT><TT>    CView::OnBeginPrinting(pDC, pInfo);</TT><TT>}</TT></FONT></PRE><H3><FONT COLOR="#000077"><B>Handling Multiple Pages in the <TT>OnPrepareDC</TT>Function</B></FONT></H3><P>The <TT>OnPrepareDC</TT> function is called just before each page is printed.The default version of this function allows one page to be printed. By modifyingthe <TT>bContinuePrinting</TT> flag, you can use this function to continue the printout.Add the source code provided in Listing 21.6 to the <TT>OnPrepareDC</TT> function.<H4><FONT COLOR="#000077">TYPE: Listing 21.6. The OnPrepareDC function.</FONT></H4><PRE><FONT COLOR="#0066FF"><TT>void CMFCPrintView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)</TT><TT>{</TT><TT>    CView::OnPrepareDC(pDC, pInfo);</TT><TT>    if( pInfo )</TT><TT>    {</TT><TT>        if( pInfo-&gt;m_nCurPage &lt; 3 )</TT><TT>            pInfo-&gt;m_bContinuePrinting = TRUE;</TT><TT>        else</TT><TT>            pInfo-&gt;m_bContinuePrinting = FALSE;</TT><TT>    }</TT><TT>}</TT></FONT></PRE><H3><FONT COLOR="#000077"><B>Modifying the MFCPrint <TT>OnPrint</TT> Function</B></FONT></H3><P>The default implementation of <TT>OnPrint</TT> calls the <TT>OnDraw</TT> memberfunction. For this example, add the source code from Listing 21.7 to <TT>OnPrint</TT>,which sends a header followed by several rows of text and a footer to the printer.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日日噜噜夜夜狠狠视频欧美人| 麻豆专区一区二区三区四区五区| 欧美视频在线一区| 精品一区二区三区在线观看国产| 中文字幕的久久| 欧美久久免费观看| 大美女一区二区三区| 五月天婷婷综合| 国产精品午夜电影| 欧美日韩成人激情| 成人网男人的天堂| 麻豆精品一二三| 亚洲国产欧美日韩另类综合 | 精品黑人一区二区三区久久| 99精品视频一区二区| 久久99久久精品欧美| 亚洲视频你懂的| 国产香蕉久久精品综合网| 欧美一区二区福利在线| 日本高清视频一区二区| 成人激情免费电影网址| 久久精品国产亚洲aⅴ| 亚洲成年人影院| 一区二区在线免费| 亚洲视频在线观看三级| 国产精品视频麻豆| 久久久99久久精品欧美| 91精品福利在线一区二区三区 | 成人午夜免费电影| 国模冰冰炮一区二区| 美女被吸乳得到大胸91| 图片区日韩欧美亚洲| 亚洲免费观看高清在线观看| 国产欧美精品一区aⅴ影院 | 2021中文字幕一区亚洲| 91精品国产手机| 欧美精品三级日韩久久| 欧美性极品少妇| 欧美性videosxxxxx| 欧美亚洲图片小说| 欧美日韩久久久一区| 欧美日韩视频专区在线播放| 欧美性受极品xxxx喷水| 欧美图区在线视频| 欧美精品一二三| 欧美二区在线观看| 4438x成人网最大色成网站| 56国语精品自产拍在线观看| 欧美一级久久久| 日韩精品一区二区三区老鸭窝 | 国产精品黄色在线观看| 国产精品网站一区| 亚洲欧美日韩国产手机在线 | 岛国一区二区三区| 99精品热视频| 欧美午夜寂寞影院| 欧美一区二区精品在线| 精品噜噜噜噜久久久久久久久试看 | 成人久久18免费网站麻豆| 播五月开心婷婷综合| 91在线观看一区二区| 在线观看欧美黄色| 91精品国产一区二区三区| 精品奇米国产一区二区三区| 久久欧美一区二区| 国产精品久久久久久久久快鸭 | 26uuu色噜噜精品一区二区| 国产欧美一区二区三区在线看蜜臀 | 欧美精品自拍偷拍| 2021久久国产精品不只是精品| 国产日韩精品一区二区浪潮av| 国产精品免费aⅴ片在线观看| 亚洲天堂成人网| 午夜精品一区在线观看| 狠狠狠色丁香婷婷综合久久五月| 成人精品免费看| 欧美中文字幕不卡| 日韩精品一区二区三区中文不卡| 中文字幕精品在线不卡| 一区二区高清在线| 精品中文av资源站在线观看| 成人免费视频视频| 欧美日韩一区二区三区视频| 精品国产成人在线影院| 国产精品久久久久一区 | 美女脱光内衣内裤视频久久网站| 国产精品一二三区| 欧美中文字幕一区二区三区| 欧美精品一区二区精品网| 综合激情成人伊人| 久久福利视频一区二区| 91丝袜美女网| 久久夜色精品国产欧美乱极品| 亚洲欧美日韩久久| 国产乱码一区二区三区| 欧美日韩精品一区二区在线播放| 国产三级精品视频| 日韩精品欧美成人高清一区二区| 丁香一区二区三区| 日韩丝袜美女视频| 一区二区在线观看视频在线观看| 国产一区二区美女| 欧美日韩国产精品成人| 中文字幕一区二区不卡| 精品在线播放午夜| 欧美日韩在线一区二区| 国产精品电影院| 韩国欧美国产一区| 7777女厕盗摄久久久| 亚洲欧洲三级电影| 国产精品一色哟哟哟| 欧美精品xxxxbbbb| 一区二区在线看| 99久久精品久久久久久清纯| 精品国产91九色蝌蚪| 天堂久久久久va久久久久| 日本精品一级二级| 中文字幕一区不卡| 国产91高潮流白浆在线麻豆 | 毛片不卡一区二区| 欧美三级电影一区| 亚洲免费视频中文字幕| 不卡一区二区在线| 久久久久久免费| 激情文学综合插| 精品美女在线观看| 久久精品国产网站| 欧美成人高清电影在线| 日韩主播视频在线| 欧美欧美欧美欧美| 天堂在线亚洲视频| 欧美日韩一卡二卡三卡| 亚洲3atv精品一区二区三区| 欧美性猛交xxxxxx富婆| 一区二区高清视频在线观看| 91蝌蚪国产九色| 亚洲天堂久久久久久久| 91亚洲大成网污www| 亚洲三级理论片| 色综合久久综合网| 亚洲精品成人精品456| 99精品偷自拍| 一区二区三区欧美亚洲| 欧美体内she精高潮| 亚洲电影在线免费观看| 欧美日韩高清不卡| 欧美aⅴ一区二区三区视频| 日韩三级电影网址| 国产一区二区三区四| 国产日韩av一区| 99久久夜色精品国产网站| 亚洲另类在线一区| 在线观看av一区二区| 天天操天天综合网| 精品少妇一区二区三区日产乱码 | 高清av一区二区| 国产精品成人免费| 91久久精品一区二区| 亚洲成a人v欧美综合天堂| 7777精品伊人久久久大香线蕉超级流畅 | 5858s免费视频成人| 精品一区二区三区影院在线午夜 | 国产suv精品一区二区883| 国产精品美女久久久久久2018 | 国产xxx精品视频大全| 亚洲三级在线免费观看| 欧美精选午夜久久久乱码6080| 麻豆国产欧美日韩综合精品二区| 久久久天堂av| 色综合久久中文综合久久97| 亚洲成人动漫在线免费观看| 日韩写真欧美这视频| 国产99一区视频免费| 亚洲精品福利视频网站| 日韩一级黄色片| 99精品国产91久久久久久| 性做久久久久久| 久久久99精品久久| 在线一区二区三区| 久久国产人妖系列| 亚洲视频图片小说| 欧美大片拔萝卜| 91天堂素人约啪| 国内成人精品2018免费看| 有坂深雪av一区二区精品| 2020国产精品自拍| 欧美日韩欧美一区二区| 国产精品一二三四五| 天堂一区二区在线| 亚洲欧洲在线观看av| 欧美一区二区在线看| 99在线精品视频| 久久精品国产精品青草| 亚洲精品ww久久久久久p站| 精品国产欧美一区二区| 欧美色窝79yyyycom| 国产成人精品一区二区三区四区| 婷婷国产在线综合| 亚洲视频在线一区| 久久久av毛片精品|