forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   3D-программирование (http://forum.boolean.name/forumdisplay.php?f=12)
-   -   CopyRect (http://forum.boolean.name/showthread.php?t=3022)

ABTOMAT 26.03.2007 14:11

CopyRect
 
Что за команда - CopyRect? Недавно нарыл её кое-где, а в хелпе ничерта про ету команды нет:dontknow: Подскажите, что у неё за параметры?

HolyDel 26.03.2007 14:28

Re: CopyRect
 
CopyRect src_x,src_y,src_width,src_height,dest_x,dest_y,[src_buffer],[dest_buffer]
Parameters
src_x = source top left x location to begin copying from
src_y = source top left y location to begin copying from
src_width = width of source area to copy
src_height = height of source area to copy
dest_x = destination top left x location to copy to
dest_y = destination top left y location to copy to
src_buffer = handle to the source image buffer (optional)
dest_buffer = handle to the destination image buffer (optional)

Description
Copies a rectangle of graphics from one buffer to another. If a buffer is omitted, the current buffer is used.

Example
; CopyRect Example

; Turn on graphics mode
Graphics 800,600,16

; create a blank image
gfxBlank=CreateImage (300,300)

; Fill the screen with random boxes in random colors
For t = 1 To 1000
Rect Rand(800),Rand(600),Rand(100),Rand(100),Rand(0,1)
Color Rand(255),Rand(255),Rand(255)
Next

; Wait a couple of seconds so the user can see it
Delay 2000

; Copy graphics randomly from the front buffer to the blank image
CopyRect Rand(800),Rand(600),300,300,0,0,FrontBuffer(),Imag eBuffer(gfxBlank)

; Clear the screen, draw the copied to image, wait for user to hit a key
Cls
DrawImage gfxBlank,0,0
WaitKey


Index

Click here to view the latest version of this page online

ABTOMAT 26.03.2007 16:42

Re: CopyRect
 
HolyDel, пасибо :-)

moka 26.03.2007 23:40

Re: CopyRect
 
CopyRect SourceX,SourceY,SourceWidth,SourceHeight,DesX,DesY ,SourceBuffer,DestBuffer
SourceX - Х Координата левого верхнего квадрата копирования.
SourceY - Y Координата левого верхнего квадрата копирования.
SourceWidth - Ширина квадрата копирования.
SourceHeight - Высота квадрата копирования.
DesX - Это X координата в которую вставлять.
DesY - Это Y координата в которую вставлять.
SourceBuffer - Буффер источника, например FrontBuffer(), тогда будет из экрана. Можно из картинки или текстуры.
DestBuffer - Куда вставляется, можно в текстуру, или картинку и т.п.


Часовой пояс GMT +4, время: 17:24.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Перевод: zCarot