copy_rectangleT_copy_rectangleCopyRectangleCopyRectanglecopy_rectangle (算子)
名称
copy_rectangleT_copy_rectangleCopyRectangleCopyRectanglecopy_rectangle — 复制输出窗口之间矩形内的所有像素。
签名
void CopyRectangle(const HTuple& WindowHandleSource, const HTuple& WindowHandleDestination, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, const HTuple& DestRow, const HTuple& DestColumn)
void HWindow::CopyRectangle(const HWindow& WindowHandleDestination, const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, const HTuple& DestRow, const HTuple& DestColumn) const
void HWindow::CopyRectangle(const HWindow& WindowHandleDestination, Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2, Hlong DestRow, Hlong DestColumn) const
static void HOperatorSet.CopyRectangle(HTuple windowHandleSource, HTuple windowHandleDestination, HTuple row1, HTuple column1, HTuple row2, HTuple column2, HTuple destRow, HTuple destColumn)
void HWindow.CopyRectangle(HWindow windowHandleDestination, HTuple row1, HTuple column1, HTuple row2, HTuple column2, HTuple destRow, HTuple destColumn)
void HWindow.CopyRectangle(HWindow windowHandleDestination, int row1, int column1, int row2, int column2, int destRow, int destColumn)
描述
copy_rectanglecopy_rectangleCopyRectangleCopyRectangleCopyRectanglecopy_rectangle copies all pixels from the window
WindowHandleSourceWindowHandleSourceWindowHandleSourceWindowHandleSourcewindowHandleSourcewindow_handle_source in the
window
WindowHandleDestinationWindowHandleDestinationWindowHandleDestinationWindowHandleDestinationwindowHandleDestinationwindow_handle_destination. It copies pixels which reside
inside a rectangle which is specified by parameters Row1Row1Row1Row1row1row_1,
Column1Column1Column1Column1column1column_1, Row2Row2Row2Row2row2row_2 and Column2Column2Column2Column2column2column_2. The target
position is specified through the upper left corner of the rectangle
(DestRowDestRowDestRowDestRowdestRowdest_row, DestColumnDestColumnDestColumnDestColumndestColumndest_column).
If you want to move more than one rectangle, you may pass them at
once (in form of the tuple mode).
You may use copy_rectanglecopy_rectangleCopyRectangleCopyRectangleCopyRectanglecopy_rectangle to copy edited graphics from an
“invisible” window in a visible window. Therefore a window with
the option 'buffer' is opened. The graphics is then displayed in
this window and is copied in a visible window afterwards. The
advantage of this strategy is, that copy_rectanglecopy_rectangleCopyRectangleCopyRectangleCopyRectanglecopy_rectangle is much
more rapid than output operators as, e.g., disp_channeldisp_channelDispChannelDispChannelDispChanneldisp_channel。This
means a particular advantage while using demo programs. You could
even realize short “clips”: you have to create for every image of
a sequence a window of a 'buffer' type and pass the data into
it. Output is the image sequence whereat all buffers are copied one
after another in a visible window.
注意
Both windows have to reside on the same display.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
WindowHandleSourceWindowHandleSourceWindowHandleSourceWindowHandleSourcewindowHandleSourcewindow_handle_source (输入控制) window → HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Source window handle.
WindowHandleDestinationWindowHandleDestinationWindowHandleDestinationWindowHandleDestinationwindowHandleDestinationwindow_handle_destination (输入控制) window → HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Destination window handle.
Row1Row1Row1Row1row1row_1 (输入控制) rectangle.origin.y(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Row index of upper left corner in the source window.
默认值:
0
值范围:
0
≤
Row1
Row1
Row1
Row1
row1
row_1
≤
511 (lin)
最小增量:
1
建议增量:
1
Column1Column1Column1Column1column1column_1 (输入控制) rectangle.origin.x(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Column index of upper left corner in the source window.
默认值:
0
值范围:
0
≤
Column1
Column1
Column1
Column1
column1
column_1
≤
511 (lin)
最小增量:
1
建议增量:
1
Row2Row2Row2Row2row2row_2 (输入控制) rectangle.corner.y(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Row index of lower right corner in the source window.
默认值:
128
值范围:
0
≤
Row2
Row2
Row2
Row2
row2
row_2
≤
511 (lin)
最小增量:
1
建议增量:
1
限制:
Row2 >= Row1
Column2Column2Column2Column2column2column_2 (输入控制) rectangle.corner.x(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Column index of lower right corner in the source window.
默认值:
128
值范围:
0
≤
Column2
Column2
Column2
Column2
column2
column_2
≤
511 (lin)
最小增量:
1
建议增量:
1
限制:
Column2 >= Column1
DestRowDestRowDestRowDestRowdestRowdest_row (输入控制) point.y(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Row index of upper left corner in the target window.
默认值:
0
值范围:
0
≤
DestRow
DestRow
DestRow
DestRow
destRow
dest_row
≤
511 (lin)
最小增量:
1
建议增量:
1
DestColumnDestColumnDestColumnDestColumndestColumndest_column (输入控制) point.x(-array) → HTupleMaybeSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Column index of upper left corner in the target window.
默认值:
0
值范围:
0
≤
DestColumn
DestColumn
DestColumn
DestColumn
destColumn
dest_column
≤
511 (lin)
最小增量:
1
建议增量:
1
示例(HDevelop)
read_image(Image,'monkey')
open_window(0,0,-1,-1,'root','buffer','',WindowHandleBuffer)
disp_obj(Image,WindowHandleBuffer)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle(WindowHandleBuffer,WindowHandle,\
Row1, Column1, Row2, Column2,Row1,Column1)
close_window(WindowHandleBuffer)
示例(C)
read_image(Image,"monkey");
open_window(0,0,-1,-1,"root","buffer","",&WindowHandle);
disp_image(Image,WindowHandle);
open_window(0,0,-1,-1,"root","visible","",&WindowHandleDestination);
do {
get_mbutton(WindowHandleDestination,&Row,&Column,&Button);
copy_rectangle(BufferID,WindowHandleDestination,90,120,390,Row,Column);
}
while(Button > 1);
close_window(WindowHandleDestination);
close_window(WindowHandle);
示例(HDevelop)
read_image(Image,'monkey')
open_window(0,0,-1,-1,'root','buffer','',WindowHandleBuffer)
disp_obj(Image,WindowHandleBuffer)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle(WindowHandleBuffer,WindowHandle,\
Row1, Column1, Row2, Column2,Row1,Column1)
close_window(WindowHandleBuffer)
示例(HDevelop)
read_image(Image,'monkey')
open_window(0,0,-1,-1,'root','buffer','',WindowHandleBuffer)
disp_obj(Image,WindowHandleBuffer)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle(WindowHandleBuffer,WindowHandle,\
Row1, Column1, Row2, Column2,Row1,Column1)
close_window(WindowHandleBuffer)
示例(HDevelop)
read_image(Image,'monkey')
open_window(0,0,-1,-1,'root','buffer','',WindowHandleBuffer)
disp_obj(Image,WindowHandleBuffer)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
draw_rectangle1 (WindowHandle, Row1, Column1, Row2, Column2)
copy_rectangle(WindowHandleBuffer,WindowHandle,\
Row1, Column1, Row2, Column2,Row1,Column1)
close_window(WindowHandleBuffer)
结果
If the output window is valid and if the specified parameters are correct
close_windowclose_windowCloseWindowCloseWindowCloseWindowclose_window 返回 2 ( H_MSG_TRUE )。如有必要,则抛出异常。
可能的前趋
open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window
可能的后继
close_windowclose_windowCloseWindowCloseWindowCloseWindowclose_window
替代
move_rectanglemove_rectangleMoveRectangleMoveRectangleMoveRectanglemove_rectangle,
slide_imageslide_imageSlideImageSlideImageSlideImageslide_image
另见
open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window
模块
基础