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

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

?? visual c++編程技巧之七.htm

?? 載之“阿蒙編程樂園”
?? HTM
?? 第 1 頁 / 共 2 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0038)http://www.vchome.net/tech/vctip7.html -->
<HTML><HEAD><TITLE>Visual C++編程技巧之七</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 5.50.4134.100" name=GENERATOR>
<META content=sss name=doccomm>
<META content=C:\MSOffice\Template\Sl_BOOK.dot name=Template>
<META content="Cheng Jinxing" name=Author></HEAD>
<BODY text=#000000 vLink=#551a8b aLink=#ff0000 link=#0000ee bgColor=#ccffff>
<P align=center><BR><FONT face=楷體_GB2312 size=+3>Visual C++編程技巧之七</FONT> </P>
<P><A href="http://www.vchome.net/tech/vctip7.html#tip49"><FONT 
face="Times New Roman" size=+0>49</FONT><FONT size=+0>、如何實現(xiàn)一個橡皮區(qū)矩形</FONT></A> 
</P>
<P><A href="http://www.vchome.net/tech/vctip7.html#tip50"><FONT 
face="Times New Roman" size=+0>50</FONT><FONT size=+0>、如何更新翻轉背景顏色的文本</FONT></A> 
</P>
<P><A href="http://www.vchome.net/tech/vctip7.html#tip51"><FONT 
face="Times New Roman" size=+0>51</FONT><FONT 
size=+0>、如何創(chuàng)建一個具有特定點大小的字體</FONT></A> </P>
<P><A href="http://www.vchome.net/tech/vctip7.html#tip52"><FONT 
face="Times New Roman" size=+0>52</FONT><FONT size=+0>、如何計算一個串的大小</FONT></A> 
</P>
<P><A href="http://www.vchome.net/tech/vctip7.html#tip53"><FONT 
face="Times New Roman" size=+0>53</FONT><FONT size=+0>、如何顯示旋轉文本</FONT></A> </P>
<P><FONT face=宋體><A 
href="http://www.vchome.net/tech/vctip7.html#tip54">54、如何正確顯示包含標簽字符的串</A></FONT> 
</P>
<P><A href="http://www.vchome.net/tech/vctip7.html#tip55"><FONT 
face="Times New Roman" size=+0>55</FONT><FONT 
size=+0>、串太長時如何在其末尾顯示一個省略號</FONT></A> </P>
<P><A href="http://www.vchome.net/tech/vctip7.html#tip56"><FONT 
face="Times New Roman" size=+0>56</FONT><FONT size=+0>、如何快速地格式化一個</FONT><FONT 
face="Times New Roman" size=+0>CString</FONT><FONT size=+0>對象</FONT></A> </P>
<P><FONT size=+2><B> </B></FONT> </P>
<P><A name=tip49></A><B><FONT size=+2><FONT 
face="Times New Roman">49</FONT><FONT face=黑體>、如何實現(xiàn)一個橡皮區(qū)矩形</FONT></FONT></B> 
</P>
<P><FONT size=+0><FONT 
face="Times New Roman">CRectTracker</FONT>是一個很有用的類,可以通過調用<FONT 
face="Times New Roman">CRectTracker:: TrackRubberBand</FONT>響應<FONT 
face="Times New Roman">WM_LBUTTONDOWN</FONT>消息來創(chuàng)建一個橡皮區(qū)矩形。下例表明使用<FONT 
face="Times New Roman">CRectTracker</FONT>移動和重置視窗中的藍色橢圓的大小是很容易的事情。</FONT> </P>
<P><FONT size=+0>首先,在文件檔中聲明一個<FONT 
face="Times New Roman">CRectTracker</FONT>數據成員:</FONT> </P>
<P><FONT face="Times New Roman" size=+0>class CSampleView : Public CView</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>{</FONT> </P>
<P><FONT size=+0>…</FONT> </P>
<P><FONT face="Times New Roman" size=+0>public :</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CrectTracker m_tracker;</FONT> </P>
<P><FONT size=+0>…</FONT> </P>
<P><FONT face="Times New Roman" size=+0>};</FONT> </P>
<P><FONT size=+0>其次,在文檔類的構造函數中初始化<FONT face="Times New Roman">CRectTracker 
</FONT>對象:</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CSampleDoc:: CSampleDOC ()</FONT> </P>
<P><FONT face="Times New Roman" size=+0>{</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Initialize tracker position, size and 
style.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>m_tracker.m_rect.SetRect (0, 0, 10, 
10);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>m_tracker.m_nStyle=CRectTracker:: 
resizeInside |</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CRectTracker:: dottedLine;</FONT> </P>
<P><FONT face="Times New Roman" size=+0>}</FONT> </P>
<P><FONT size=+0>然后,在<FONT 
face="Times New Roman">OnDraw</FONT>函數中畫橢圓和蹤跡矩形:</FONT> </P>
<P><FONT face="Times New Roman" size=+0>void CSampleView:: OnDraw (CDC* 
pDC)</FONT> </P>
<P><FONT face="Times New Roman" size=+0>{</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CSampleDoc* pDoc=GetDocument ();</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>ASSERT_VALID (pDoc);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Select blue brush into device 
context.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CBrush brush (RGB (0, 0, 255));</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>CBrush* pOldBrush=pDC-&gt;SelectObject 
(&amp;brush);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//draw ellipse in tracking 
rectangle.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>Crect rcEllipse;</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDoc-&gt;m_tracker.GetTrueRect 
(rcEllipse);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDC-&gt;Ellipse (rcEllipse);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Draw tracking rectangle.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDoc-&gt;m_tracker.Draw (pDC);</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>//Select blue brush out of device 
context.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDC-&gt;Selectobject (pOldBrush);</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>}</FONT> </P>
<P><FONT size=+0>最后,使用<FONT face="Times New Roman">ClassWizard</FONT>處理<FONT 
face="Times New Roman">WM_LBUTTONDOWN</FONT>消息,并增加下述代碼。該段代碼根據鼠標擊鍵情況可以拖放、移動或者重置橢圓的大小。</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>void CSampleView::OnLButtonDown (UINT 
nFlags, CPoint point)</FONT> </P>
<P><FONT face="Times New Roman" size=+0>{</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Get pointer to document.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CSampleDoc* pDoc=GetDocument ();</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>ASSERT_VALID (pDoc);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//If clicked on ellipse, drag or resize 
it. Otherwise create a</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//rubber-band rectangle nd create a new 
ellipse.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>BOOL bResult=pDoc-&gt;m_tracker.HitTest 
(point)!=</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CRectTracker::hitNothing;</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Tracker rectangle changed so update 
views.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>if (bResult)</FONT> </P>
<P><FONT face="Times New Roman" size=+0>{</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDoc-&gt;m_tracker.Track 
(this,point,TRue);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDoc-&gt;SetModifiedFlag ();</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDoc-&gt;UpdateAllViews (NULL);</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>}</FONT> </P>
<P><FONT face="Times New Roman" size=+0>else</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDoc-&gt;m-tracker.TrackRubberBand 
(this,point,TRUE);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CView:: onLButtonDown 
(nFlags,point);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>}</FONT> </P>
<P><A name=tip50></A><B><FONT size=+2><FONT 
face="Times New Roman">50</FONT><FONT face=黑體>、如何更新翻轉背景顏色的文本</FONT></FONT></B> 
</P>
<P><FONT size=+0>調用<FONT face="Times New Roman">CDC:: SetBkmode</FONT>并傳送<FONT 
face="Times New Roman">OPAQUE</FONT>用當前的背景顏色填充背景,或者調用<FONT 
face="Times New Roman">CDC::SetBkMode</FONT>并傳送<FONT 
face="Times New Roman">TRANSPAARENT</FONT>使背景保持不變,這兩種方法都可以設置背景模式。下例設置背景模式為<FONT 
face="Times New Roman">TRANSPARENT</FONT>,可以兩次更新串,用花色帶黑陰影更新文本。黑色串在紅色串之后,但由于設置了背景模式仍然可見。</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>void CSampleView:: OnDraw (CDC* 
pDC)</FONT> </P>
<P><FONT face="Times New Roman" size=+0>{</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Determint size of view.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CRect rcView;</FONT> </P>
<P><FONT face="Times New Roman" size=+0>GetClientRect (rcVieew);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Create sample string to 
display.</FONT> </P>
<P><FONT size=+0><FONT face="Times New Roman">CString str (_T ("Awesome Shadow 
Text</FONT>...<FONT face="Times New Roman">"));</FONT></FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Set the background mode to 
transparent.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDC-&gt;SetBKMode (TRANSPARENT);</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>//Draw black shadow text.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>rcView.OffsetRect (1, 1);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDc-&gt;SetTextColor (RGB (0, 0, 
0));</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDC-&gt;DrawText (str, str.GetLength (), 
rcView,</FONT> </P>
<P><FONT face="Times New Roman" size=+0>DT_SINGLELINE | DT_CENTER | 
DT_VCENTER);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>//Draw red text.</FONT> </P>
<P><FONT face="Times New Roman" size=+0>rcView.OffsetRect (-1,-1);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDc-&gt;SetTextColor (RGB (255, 0, 
0));</FONT> </P>
<P><FONT face="Times New Roman" size=+0>pDC-&gt;DrawText (str, str.GetLength (), 
rcView,</FONT> </P>
<P><FONT face="Times New Roman" size=+0>DT_SINGLELINE | DT_CENTER | 
DT_VCENTER);</FONT> </P>
<P><FONT face="Times New Roman" size=+0>}</FONT> </P>
<P><A name=tip51></A><B><FONT size=+2><FONT 
face="Times New Roman">51</FONT><FONT 
face=黑體>、如何創(chuàng)建一個具有特定點大小的字體</FONT></FONT></B> </P>
<P><FONT size=+0>可以指定字體邏輯單位的大小,但有時指定字體的點的大小可能會更方便一些。可以如下將字體的點轉換為字體的高度:</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>int nHeigth=mulDiv (nPointSize, 
-dc.GetDeviceCaps (LOGPIXELSY), 72);</FONT> </P>
<P><FONT size=+0>下例創(chuàng)建了一個<FONT face="Times New Roman">8</FONT>點的<FONT 
face="Times New Roman">Apial</FONT>字體:</FONT> </P>
<P><FONT face="Times New Roman" size=+0>CClientDC dc (AqfxGetMainWnd ());</FONT> 
</P>
<P><FONT face="Times New Roman" size=+0>m_font. CreateFont (MulDiv (8, 
-dc.GetDeviceCaps (LOGPIXELSY),</FONT> </P>
<P><FONT face="Times New Roman" 
size=+0>72),0,0,0,FW_NORMAL,0,0,0,ANSI_CHARSET,</FONT> </P>
<P><FONT face="Times New Roman" 
size=+0>OUT_STROKE_PRECIS,CLIP_STROKE_PRECIS,DRAFT_QUALITY,</FONT> </P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
另类小说一区二区三区| 欧美吞精做爰啪啪高潮| 日韩午夜av一区| 免费成人结看片| 欧美精品一区二区蜜臀亚洲| 国产成人亚洲精品青草天美| 日本一区二区三区在线不卡| 99精品欧美一区二区三区小说| 成人欧美一区二区三区小说 | 午夜精品久久久久久久99樱桃| 欧美色图一区二区三区| 91一区二区三区在线播放| 国产精品久久久久桃色tv| 99re66热这里只有精品3直播 | 欧美精品乱码久久久久久| 蜜桃视频一区二区| 国产丝袜美腿一区二区三区| 色综合久久中文综合久久牛| 亚洲国产精品久久久久秋霞影院| 日韩午夜激情免费电影| 国产精品18久久久久久vr| 中文字幕成人网| 欧美日韩国产在线播放网站| 国产一区 二区 三区一级| 亚洲三级在线观看| 欧美大白屁股肥臀xxxxxx| 北岛玲一区二区三区四区| 亚洲综合成人在线视频| www久久久久| 欧美在线播放高清精品| 国内偷窥港台综合视频在线播放| 亚洲天堂av一区| 日韩一区二区三区在线观看| eeuss鲁片一区二区三区在线看| 午夜久久福利影院| 亚洲国产高清在线| 67194成人在线观看| 国产91清纯白嫩初高中在线观看| 亚洲国产美女搞黄色| 国产欧美一区二区三区在线看蜜臀 | 国产精品亲子乱子伦xxxx裸| 欧美性生活影院| 国产福利不卡视频| 日韩电影在线观看电影| 亚洲欧洲日韩av| 精品日韩一区二区三区| 欧美性淫爽ww久久久久无| 国产成人精品三级| 日产精品久久久久久久性色| 亚洲九九爱视频| 日本一区二区不卡视频| 精品国产精品网麻豆系列| 欧美日精品一区视频| 成人av在线网站| 国产精品资源在线| 久久国产三级精品| 日韩国产成人精品| 亚洲成人资源在线| 亚洲女爱视频在线| 亚洲欧美中日韩| 中文字幕不卡在线播放| 久久久久久久久久电影| 欧美日韩一级片在线观看| 成人av影院在线| 久久成人久久鬼色| 五月激情综合色| 亚洲第一成年网| 亚洲国产精品久久艾草纯爱| 亚洲乱码中文字幕综合| 亚洲少妇最新在线视频| 亚洲人成精品久久久久久| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 日韩精品资源二区在线| 91.com视频| 欧美久久一二三四区| 欧美美女黄视频| 777欧美精品| 欧美成人国产一区二区| 日韩一区二区三区精品视频| 91精品国产福利在线观看 | 高清国产一区二区| 风间由美一区二区三区在线观看| 国产成人一级电影| 欧美一区二区三区视频在线| 欧美挠脚心视频网站| 91精品国产综合久久久久久漫画| 欧美日韩三级一区| 欧美一区二区三区四区五区| 日韩无一区二区| 久久久久久久一区| 欧美—级在线免费片| 国产精品成人网| 亚洲精品视频一区二区| 亚洲国产欧美另类丝袜| 蜜桃视频在线观看一区二区| 国产一区二区在线观看视频| 成人av手机在线观看| 99久久伊人精品| 欧美在线免费观看视频| 欧美一级二级三级乱码| 国产三级精品视频| 亚洲精品欧美激情| 日本不卡在线视频| 国产风韵犹存在线视精品| 97se狠狠狠综合亚洲狠狠| 欧美性做爰猛烈叫床潮| 精品国产免费久久| ...xxx性欧美| 日本欧美久久久久免费播放网| 国内精品久久久久影院一蜜桃| 成人av综合一区| 欧美日本国产视频| 国产欧美一区在线| 亚洲bt欧美bt精品| 国产成人av福利| 欧美视频日韩视频在线观看| 欧美第一区第二区| 亚洲男人的天堂av| 久久99热这里只有精品| 色乱码一区二区三区88| 精品国产三级电影在线观看| 亚洲人精品午夜| 国产揄拍国内精品对白| 色猫猫国产区一区二在线视频| 精品盗摄一区二区三区| 亚洲人精品一区| 国产一区视频在线看| 在线免费观看不卡av| 2024国产精品| 五月婷婷综合激情| 欧美一级二级三级乱码| 国产精品久久久久aaaa樱花| 久久精品国产第一区二区三区| 91网页版在线| 国产视频视频一区| 免费观看成人鲁鲁鲁鲁鲁视频| 一本大道久久a久久综合| 久久先锋资源网| 丝袜美腿亚洲一区二区图片| 成人动漫av在线| 欧美精品一区二区三区高清aⅴ | 天天亚洲美女在线视频| 成人免费看视频| 欧美mv日韩mv国产| 天天操天天色综合| 欧美系列日韩一区| 亚洲品质自拍视频网站| 高清久久久久久| 久久精品欧美日韩精品| 另类小说欧美激情| 欧美一区二区在线看| 亚洲国产精品精华液网站| 成人97人人超碰人人99| 国产日韩影视精品| 狠狠色丁香婷婷综合| 日韩一区二区电影在线| 亚洲va韩国va欧美va精品| 在线视频中文字幕一区二区| 亚洲免费在线看| 99久久精品免费| 中文字幕色av一区二区三区| 成人精品一区二区三区四区| 国产无人区一区二区三区| 国产精品中文字幕日韩精品 | 精品国产乱码久久久久久老虎| 日韩影视精彩在线| 欧美精品一二三四| 午夜电影网一区| 91精品国产综合久久福利| 日韩中文字幕不卡| 亚洲精品国产无套在线观| 99精品视频一区| 一区二区三区在线高清| 色悠久久久久综合欧美99| 一区二区在线看| 色综合色狠狠综合色| 一区二区欧美精品| 欧美日韩精品一区视频| 日韩二区三区在线观看| 91精品国产综合久久香蕉的特点| 亚洲国产aⅴ成人精品无吗| 欧美精品一二三四| 九九视频精品免费| 久久久久高清精品| 99视频精品全部免费在线| 自拍av一区二区三区| 欧美三级电影一区| 青青草国产精品亚洲专区无| 久久日一线二线三线suv| 成人伦理片在线| 一区二区国产盗摄色噜噜| 7777精品伊人久久久大香线蕉最新版| 午夜电影久久久| 久久久五月婷婷| 99在线精品免费| 午夜精品一区二区三区免费视频| 欧美成人一区二区三区在线观看| 国产在线不卡视频| 一区二区不卡在线播放 | 久久99久久久久久久久久久|