?? c++ builder 初學問與答(八).htm
字號:
· <a href=/article/5/11/2006/200608301360.html title='Google排名—搜索引擎登記技巧'>Google排名—搜索引..</a><br>
· <font color='#0066FF'>[圖文]</font> <a href=/article/10/2006/200608291188.html title='菜鳥安全防患之餓死木馬'>菜鳥安全防患..</a><br>
· <a href=/article/9/2006/20060827361.html title='數學最大數字'>數學最大數字</a><br>
· <a href=/article/10/2006/200608291195.html title='Google搜索技巧(6):用Google找自己'>Google搜索技巧(6):..</a><br></td>
</tr>
<tr>
<td height="2" bgcolor="#FFFFFF"></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="titleback1">相關文章</td>
</tr>
<tr>
<td height="100" valign="top">· <a href="/article/1/14/2006/2006092518481.html" title='《c++ primer》讀書筆記4'>《c++ primer》讀書..</a><br>
· <a href="/article/1/14/2006/2006092518480.html" title='《c++ primer》讀書筆記6'>《c++ primer》讀書..</a><br>
· <a href="/article/1/14/2006/2006092518477.html" title='一個有意思的C++ trick (2)'>一個有意思的C++ tr..</a><br>
· <a href="/article/1/14/2006/2006092518473.html" title='《c++ primer》讀書筆記3'>《c++ primer》讀書..</a><br>
· <a href="/article/1/14/2006/2006092518472.html" title='《c++ primer》讀書筆記5'>《c++ primer》讀書..</a><br>
· <a href="/article/1/14/2006/2006092518470.html" title='如何在C++ Builder的DLL中使用數據庫控件'>如何在C++ Builder的..</a><br>
· <a href="/article/1/14/2006/2006092518469.html" title='Python 與 C++ 程序的簡單實例對比'>Python 與 C++ 程序..</a><br>
· <a href="/article/1/14/2006/2006092518468.html" title='Visual C++ MFC 一文說盡 (推薦)(很長,沒耐心就不要看了)'>Visual C++ MFC 一文..</a><br>
· <a href="/article/1/14/2006/2006092518466.html" title='VC++ Members Weblog'>VC++ Members Weblo..</a><br>
· <a href="/article/1/14/2006/2006092518459.html" title='C++ Builder和托管C++中屬性的使用建議'>C++ Builder和托管C..</a><br></td>
</tr>
</table>
</td>
<td width="588" align="right" class="tableright">
<table width="575" border="0" cellpadding="0" cellspacing="0" style="table-layout:fixed;word-break:break-all">
<tr>
<td align="center" height=32 style="font-size: 12pt;color: #FF6600;">C++ Builder 初學問與答(八)</td>
</tr>
<tr>
<td align="center" height=25 bgcolor=#F7F7F7>作者:佚名 來源:不詳 發布時間:25/09/2006 19:29:18 發布人:admin</td>
</tr>
<script language=javascript>
var newasp_fontsize=9;
var newasp_lineheight=12;
</script>
<tr>
<td><p align="right"><a style="CURSOR: hand; POSITION: relative" onclick="if(newasp_fontsize>8){NewaspContentLabel.style.fontSize=(--newasp_fontsize)+"pt";NewaspContentLabel.style.lineHeight=(--newasp_lineheight)+"pt";}" title="減小字體"><img src="/images/1.gif" border="0" width="15" height="15"><font color="#FF6600">減小字體</font></a>
<a style="CURSOR: hand; POSITION: relative" onclick="if(newasp_fontsize<64){NewaspContentLabel.style.fontSize=(++newasp_fontsize)+"pt";NewaspContentLabel.style.lineHeight=(++newasp_lineheight)+"pt";}" title="增大字體"><img src="/images/2.gif" border="0" width="15" height="15"><font color="#FF6600">增大字體</font></a>
</p>
<div id="NewaspContentLabel" style="display:block;padding:0px 10px;" class="ContentFont"><FONT id=font_word style="FONT-SIZE: 14px; FONT-FAMILY: 宋體, Verdana, Arial, Helvetica, sans-serif"><H3 style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><FONT size=3>(版權聲明:本系列文章僅供CSDN使用,另授權CCRUN轉載,其他個人與網站未經作者或CSDN同意不得轉載、摘抄)</FONT></H3><P style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"> </P><H3 style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><A name=_Toc494088147><SPAN style="mso-bookmark: _Toc494087975"><SPAN lang=EN-US><FONT face=宋體 size=3>8.圖形類組件</FONT></SPAN></SPAN></A></H3><P class=MsoNormalIndent style="MARGIN: 0cm 0cm 0pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN lang=EN-US> 59</SPAN></B><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)問:</SPAN></B><SPAN lang=EN-US><a target="_blank" href="http://www.malegebide.com" class="wordstyle">Windows</a></SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">是一個圖形系統,</SPAN><SPAN lang=EN-US>C++Builder</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">是怎樣處理圖形的呢?</SPAN></FONT></P><P class=MsoNormalIndent style="MARGIN: 0cm 0cm 0pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''"> 答:</SPAN></B><SPAN lang=EN-US>C++Builder</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">通過提供圖形組件來處理圖形,其中比較常用的有圖像組件(</SPAN><SPAN lang=EN-US>Image</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)、幾何圖形組件(</SPAN><SPAN lang=EN-US>Shape</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)和畫板組件(</SPAN><SPAN lang=EN-US>PaintBox</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)。前兩個組件位于</SPAN><SPAN lang=EN-US>Additional</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">頁中,畫板組件位于</SPAN><SPAN lang=EN-US>System</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">頁中。</SPAN></FONT></P><P class=MsoNormalIndent style="MARGIN: 0cm 0cm 0pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">在</SPAN><SPAN lang=EN-US>BCB</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">中,</SPAN><SPAN lang=EN-US>Form</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">、</SPAN><SPAN lang=EN-US>Image</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">、</SPAN><SPAN lang=EN-US>BitMap</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">、</SPAN><SPAN lang=EN-US>PaintBox</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">等都具有繪圖能力,這些組件中都有</SPAN><SPAN lang=EN-US>Canvas</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US><FONT size=3> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN lang=EN-US>60</SPAN></B><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)問:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">圖像控件有哪些特殊的屬性?</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">答:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">圖像組件可以顯示各種以文件形式存儲在磁盤上的圖形。它有這樣一些特殊的屬性。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>AutoSize</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性,當屬性值為</SPAN><SPAN lang=EN-US>True</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">時,圖像組件會自動調節尺寸以便適應圖像組件的大小。缺省值為</SPAN><SPAN lang=EN-US>True</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Stretch</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性,當該屬性為</SPAN><SPAN lang=EN-US>True</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">時,圖像的尺寸自動調整并填滿整個圖像組件的范圍。但</SPAN><SPAN lang=EN-US>ICO</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">文件無法產生這種效果。缺省值為</SPAN><SPAN lang=EN-US>False</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Transparent</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性,確定是否允許圖像中指定的顏色透明,從而使組件下面的物體顯示出來。缺省值為</SPAN><SPAN lang=EN-US>False</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Center</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性,當該屬性為</SPAN><SPAN lang=EN-US>True</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">時,圖像居中顯示;否則,從左上角開始顯示。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性</SPAN><SPAN lang=EN-US>Picture</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">,你可以在設計階段利用這個屬性指定所要顯示的圖片,也可以在運行期間再顯示。前面一種情況下,你可以單擊</SPAN><SPAN lang=EN-US>Picture</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性的</SPAN><SPAN lang=EN-US>Value</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">列中的省略號按鈕,這時會出現一個圖片編輯對話框,單擊對話框中的</SPAN><SPAN lang=EN-US>Load</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">按鈕就可以選擇載入要顯示的圖片了。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><B><SPAN lang=EN-US><FONT size=3> <o:p></o:p></FONT></SPAN></B></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN lang=EN-US>61</SPAN></B><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)問:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">如果是在程序運行期間載入圖片,應該怎么辦?</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">答:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">如果是在程序運行期間載入圖片,那么可以使用</SPAN><SPAN lang=EN-US>TPicture</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">類的方法</SPAN><SPAN lang=EN-US>LoadFromFile</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">,這個方法可以載入存儲在磁盤上的圖像文件。例如要載入</SPAN><SPAN lang=EN-US>D</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">盤根目錄下的</SPAN><SPAN lang=EN-US>picture.bmp</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">,可以這樣調用:</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Image1->Picture->LoadFromFile("d:\\picture.bmp")</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">;</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">這個控件可處理的圖片文件的類型有:</SPAN><SPAN lang=EN-US>.BMP</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">文件、</SPAN><SPAN lang=EN-US>.ICO</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">文件、</SPAN><SPAN lang=EN-US>.EMF</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">和</SPAN><SPAN lang=EN-US>.WMF</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">等多種圖像文件。如果你試圖載入一種無法識別的文件類型,將會產生異常錯誤。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US><FONT size=3> <o:p></o:p></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN lang=EN-US>62</SPAN></B><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)問:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">能說一下</SPAN><SPAN lang=EN-US>AutoSize</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">與</SPAN><SPAN lang=EN-US>Stretch</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">的區別嗎?</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">答:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">好的,在窗體上放置兩個圖像組件,將左邊的圖像組件的</SPAN><SPAN lang=EN-US>AutoSize</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性為</SPAN><SPAN lang=EN-US>True</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">,所以載入任何圖片后,組件的尺寸與圖片的尺寸完全相同。而且如果你增大或減小圖像組件的尺寸,圖片的顯示仍然不變。將右邊的圖像組件的</SPAN><SPAN lang=EN-US>AutoSize</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性設置為</SPAN><SPAN lang=EN-US>False</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">,將它的</SPAN><SPAN lang=EN-US>Stretch</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性設置為</SPAN><SPAN lang=EN-US>True</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">。當你增大或減小圖像組件的尺寸,圖片將按比例增大或縮小,也就是說圖片始終充滿整個組件。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US><FONT size=3> <o:p></o:p></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN lang=EN-US>63</SPAN></B><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)問:</SPAN></B><SPAN lang=EN-US>TShape</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">控件有什么重要屬性?</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">答:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">這個組件可以顯示一些常見的幾何圖形,例如矩形、圓、橢圓等。幾何圖形組件有幾個比較重要的屬性:</SPAN><SPAN lang=EN-US>Brush</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">,</SPAN><SPAN lang=EN-US>Pen </SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">和</SPAN><SPAN lang=EN-US>Shape</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Brush</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性,用來設置幾何圖形內部的填充特性,包括填充的圖案(</SPAN><SPAN lang=EN-US>Style</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)和顏色</SPAN><SPAN lang=EN-US>(Color)</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">等。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Pen</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性,用來設置幾何圖形的外框特性,包括畫筆的顏色</SPAN><SPAN lang=EN-US>(Color)</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">、線型</SPAN><SPAN lang=EN-US>(Style)</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">和線寬</SPAN><SPAN lang=EN-US>(Width)</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">及</SPAN><SPAN lang=EN-US>Mode</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">關系等。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性</SPAN><SPAN lang=EN-US>Shape</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">,用來指出所顯示的幾何圖形類型。這個屬性可以有六種不同的值,分別表示六種不同的幾何圖形;</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">(</SPAN><SPAN lang=EN-US>1</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)</SPAN><SPAN lang=EN-US>stEllipse</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示橢圓。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">(</SPAN><SPAN lang=EN-US>2</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)</SPAN><SPAN lang=EN-US>stRectangle</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示矩形。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">(</SPAN><SPAN lang=EN-US>3</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)</SPAN><SPAN lang=EN-US>stRoundRect</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示圓角矩形。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">(</SPAN><SPAN lang=EN-US>4</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)</SPAN><SPAN lang=EN-US>stRoundSquare</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示圓角正方形。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">(</SPAN><SPAN lang=EN-US>5</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)</SPAN><SPAN lang=EN-US>stSquare</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示正方形。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">(</SPAN><SPAN lang=EN-US>6</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)</SPAN><SPAN lang=EN-US>stCircle</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示圓。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: center; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt" align=center><SPAN lang=EN-US><FONT size=3> <o:p></o:p></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">在設計階段,你可以使用鼠標改變圖形的尺寸。在運行期間,可以通過</SPAN><SPAN lang=EN-US>Height</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">和</SPAN><SPAN lang=EN-US>Width</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性改變圖形的尺寸。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US><FONT size=3> <o:p></o:p></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN lang=EN-US>64</SPAN></B><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)問:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性</SPAN><SPAN lang=EN-US>Brush</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">前面有一個加號,它是什么意思?</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">答:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">它表示這個屬性是可以展開的,也就是說,它還包含一些子屬性。單擊加號,可以發現它的子屬性是:</SPAN><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">和</SPAN><SPAN lang=EN-US>Style</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性包含一系列</SPAN><SPAN lang=EN-US>C++Builder</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">預定義的顏色,你可以從中為顯示的幾何圖形選擇一種填充顏色。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Style</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性確定了幾何圖形的填充樣式,它可以分別取這樣</SPAN><SPAN lang=EN-US>8</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">種值:</SPAN><SPAN lang=EN-US>bsBDiagonal, bsClear, bsCross, bsDiagCross, bsDiagonal, bsHorizontal, bsSolid</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">和</SPAN><SPAN lang=EN-US>bsVertical</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性</SPAN><SPAN lang=EN-US>Pen</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">也象屬性</SPAN><SPAN lang=EN-US>Brush</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">一樣有子屬性。它的子屬性是</SPAN><SPAN lang=EN-US>Color, Mode, Style</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">和</SPAN><SPAN lang=EN-US>Width</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">。其中最常用的就是</SPAN><SPAN lang=EN-US>Style</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">和</SPAN><SPAN lang=EN-US>Width</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">,它們分別表示線型和線寬。子屬性</SPAN><SPAN lang=EN-US>Style</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">可以取這樣一些值來畫邊框:</SPAN></FONT></P><TABLE style="MARGIN-LEFT: 5.4pt; BORDER-COLLAPSE: collapse; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=0><TR><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 136.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=182><P class=MsoToc1 style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US>psSolid</SPAN></P></TD><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 158.9pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=212><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示實線。</SPAN></P></TD></TR><TR><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 136.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=182><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US>psDash</SPAN></P></TD><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 158.9pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=212><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示破折號。</SPAN></P></TD></TR><TR><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 136.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=182><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US>psDot</SPAN></P></TD><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 158.9pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=212><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示圓點。</SPAN></P></TD></TR><TR><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 136.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=182><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US>psDashDot</SPAN></P></TD><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 158.9pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=212><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示破折號和圓點。</SPAN></P></TD></TR><TR><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 136.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=182><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US>psDashDotDot</SPAN></P></TD><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 158.9pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=212><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示破折號、圓點、圓點。</SPAN></P></TD></TR><TR><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 136.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=182><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US>psClear</SPAN></P></TD><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 158.9pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=212><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示沒有線。</SPAN></P></TD></TR><TR><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 136.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=182><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US>psInsideFrame</SPAN></P></TD><TD style="BORDER-RIGHT: #ece9d8; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 158.9pt; PADDING-TOP: 0cm; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent" vAlign=top width=212><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">表示內框實線。</SPAN></P></TD></TR></TABLE><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN lang=EN-US><FONT size=3> <o:p></o:p></FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN lang=EN-US>65</SPAN></B><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)問:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">這個畫板組件有什么作用?</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">答:</SPAN></B><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">畫板組件主要為用戶提供一塊作圖區域,<font id="lpomqgnjjntrv">的教1Tarz_)8{bG</font>用戶可以使用繪圖語句在這個作圖區域上畫出各種不同的圖形。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''"><FONT size=3>要注意的是,由于畫板組件沒有邊界,所以通常應該把它放在一個有邊界的容器類組件上。</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">畫板組件主要使用</SPAN><SPAN lang=EN-US>Canvas</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性來進行繪圖工作。</SPAN><SPAN lang=EN-US>Canvas</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">(畫布)是類</SPAN><SPAN lang=EN-US>TCanvas</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">的對象,<div id="urstsplqpjn">教專I8S%3.vvx</div>類</SPAN><SPAN lang=EN-US>TCanvas</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">包含繪圖中使用的各種方法和屬性。下面我們首先介紹</SPAN><SPAN lang=EN-US>Canvas</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">對象的各種屬性。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">畫筆(</SPAN><SPAN lang=EN-US>Pen</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">)</SPAN><SPAN lang=EN-US><SPAN style="mso-spacerun: yes"> </SPAN>Canvas</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">對象中有一個畫筆成員,它確定繪制幾何圖形時使用的畫筆類型。剛才我們介紹了畫筆的線型和線寬。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">畫筆的</SPAN><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性是繪圖時使用的前景色。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">畫筆的屬性</SPAN><SPAN lang=EN-US>Mode</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">用來確定畫筆與屏幕上原有點的混合方式。可結合當前的顏色、屏幕的顏色或它們的反轉值,<span id="diotncmodbddllsor">.的&,[中8x-無S|%業網教p</span>對線段的顏色重新定義。但不改變</SPAN><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''"><FONT size=3>它可以取這樣一些值:</FONT></SPAN></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>pmBlack</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">:表示用黑色繪圖;</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>pmWhite</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">:表示用白色繪圖;</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>pmNot</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">:畫筆繪制的點的顏色與原有的顏色相反;</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>pmCopy</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">:畫筆用</SPAN><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性中定義的顏色繪圖。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>PmNotCopy</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">:畫筆用</SPAN><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性中定義的顏色的反轉色繪圖;</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>PmMergePenNot</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">:畫筆用</SPAN><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性中定義的顏色與屏幕顏色的反轉色結合后繪圖;</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 23.5pt"><FONT size=3><SPAN lang=EN-US>PmMaskNotPen</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">:畫筆用屏幕顏色與</SPAN><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性中定義的顏色結合后繪圖;</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>PmMergeNotPen</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">:畫筆用屏幕顏色與</SPAN><SPAN lang=EN-US>Color</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性中定義的顏色的反轉值結合后繪圖。</SPAN></FONT></P><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt"><FONT size=3><SPAN lang=EN-US>Brush</SPAN><SPAN style="FONT-FAMILY: 宋體; mso-ascii-font-family: ''''Times New Roman''''; mso-hansi-font-family: ''''Times New Roman''''">屬性,刷子屬性在前面已經詳細介紹過,
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -