“AttachCopyToView 指令”的版本间的差异
来自GeoGebra Manual
(建立内容为“<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}} ;AttachCopyToView( <Object>, <View 0|1|2> ) :If ''View = 0'', a copy of given object is c…”的新页面) |
|||
第1行: | 第1行: | ||
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}} | <noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|scripting}} | ||
− | ;AttachCopyToView( < | + | ;AttachCopyToView( < 物件>, < 視區 0|1|2> ) |
− | : | + | : 若 <視區> 為 0 ,(會在主繪圖區)建立 <物件> 的應變副本。若 <視區> 為 1 或 2 ,會在指定的 [[File: Menu view graphics.svg|link=|16px]] (主、副)[[ 繪圖區]] 建立 <物件> 的應變副本,但這些副本的尺寸會是常數。 |
− | :{{Example|1=<div> | + | :{{Example|1=<div> 令 <code><nowiki>poly = Polygon((0, 0), (1, 0), (1, 1), (0, 1))</nowiki></code> 。<br> 輸入 <code><nowiki>AttachCopyToView(poly, 1)</nowiki></code> 會在相同位置建立一個相同尺寸的正方形。</div>}} |
− | :{{Note| | + | :{{Note| 一旦副本建立後,GeoGebra 會自動在副本物件的定義欄位補上剩下四個引數到指令中(請參考下一個語法)。}} |
− | ;AttachCopyToView( < | + | ;AttachCopyToView( < 物件>, < 視區 0|1|2>, < 點 1>, < 點 2>, < 螢幕點 1>, < 螢幕點 2> ) |
:If ''View = 0'', a copy of given object is created. For ''View = 1'' or ''View = 2'' this command creates a dependent copy of given object whose size in given [[File: Menu view graphics.svg|link=|16px]] [[Graphics View]] is transformed using the affine transform that maps ''Point 1'' to a point whose screen coordinates (in pixels) are equal to ''Screen Point 1'', and ''Point 2'' to a point with screen coordinates equal to ''Screen Point 2''. | :If ''View = 0'', a copy of given object is created. For ''View = 1'' or ''View = 2'' this command creates a dependent copy of given object whose size in given [[File: Menu view graphics.svg|link=|16px]] [[Graphics View]] is transformed using the affine transform that maps ''Point 1'' to a point whose screen coordinates (in pixels) are equal to ''Screen Point 1'', and ''Point 2'' to a point with screen coordinates equal to ''Screen Point 2''. | ||
:{{Example|1=<div>Let <code><nowiki>poly = Polygon((0, 0), (1, 0), (1, 1), (0, 1))</nowiki></code>. <br> If Graphics View 1 is active, <code><nowiki>AttachCopyToView(poly, 1, (0, 0), (1, 1), (0, 0), (100, 100))</nowiki></code> creates a ''100px x 100px'' square in the top left corner of the Graphics View.</div>}} | :{{Example|1=<div>Let <code><nowiki>poly = Polygon((0, 0), (1, 0), (1, 1), (0, 1))</nowiki></code>. <br> If Graphics View 1 is active, <code><nowiki>AttachCopyToView(poly, 1, (0, 0), (1, 1), (0, 0), (100, 100))</nowiki></code> creates a ''100px x 100px'' square in the top left corner of the Graphics View.</div>}} | ||
:{{note|1=All points of the object are copied, even if they lie outside the view.}} | :{{note|1=All points of the object are copied, even if they lie outside the view.}} |
2024年1月9日 (二) 03:36的版本
本頁為官方文件,一般使用者無法修改,若有任何誤謬,請與官方聯絡。如欲編輯,請至本頁的開放版。
- AttachCopyToView( <物件>, <視區 0|1|2> )
- 若 <視區> 為 0,(會在主繪圖區)建立 <物件> 的應變副本。若 <視區> 為 1 或 2,會在指定的 (主、副)繪圖區建立 <物件> 的應變副本,但這些副本的尺寸會是常數。
- 範例:令
poly = Polygon((0, 0), (1, 0), (1, 1), (0, 1))
。
輸入AttachCopyToView(poly, 1)
會在相同位置建立一個相同尺寸的正方形。 - 備註: 一旦副本建立後,GeoGebra 會自動在副本物件的定義欄位補上剩下四個引數到指令中(請參考下一個語法)。
- AttachCopyToView( <物件>, <視區 0|1|2>, <點 1>, <點 2>, <螢幕點 1>, <螢幕點 2> )
- If View = 0, a copy of given object is created. For View = 1 or View = 2 this command creates a dependent copy of given object whose size in given Graphics View is transformed using the affine transform that maps Point 1 to a point whose screen coordinates (in pixels) are equal to Screen Point 1, and Point 2 to a point with screen coordinates equal to Screen Point 2.
- 範例:Let
poly = Polygon((0, 0), (1, 0), (1, 1), (0, 1))
.
If Graphics View 1 is active,AttachCopyToView(poly, 1, (0, 0), (1, 1), (0, 0), (100, 100))
creates a 100px x 100px square in the top left corner of the Graphics View. - 備註: All points of the object are copied, even if they lie outside the view.