BBC BASIC for Windows
Programming >> Graphics and Games >> Copying rectangles..
http://bb4w.conforums.com/index.cgi?board=graphics&action=display&num=1381329836

Copying rectangles..
Post by afarlie on Oct 9th, 2013, 2:43pm

First the example code.
10 VDU 23,22,640;480;8,8,16,0
CLS
20 REM DATA
30 MOVE 0,0
40 GCOL 0,1

50 ORIGIN 0,(1024)
60 MOVE 0,0
70 DRAW 99,-99
80
RECTANGLE 0,-99,99,99 TO 100,-200:REM Block copy 100 by 100
RECTANGLE 0,-99,99,99 TO 200,-300

The line should be continuous, with start points being
0,-100 ; 100,-200 ; 200,-300 respectively

The documentation does not say that in block copy operations the dx dy are 'inclusive' or exclusive.

Perhaps someone here would be willing to explain?




Re: Copying rectangles..
Post by admin on Oct 9th, 2013, 3:06pm

on Oct 9th, 2013, 2:43pm, afarlie wrote:
The documentation does not say that in block copy operations the dx dy are 'inclusive' or exclusive.

This section of the documentation says that graphics coordinates of a solid rectangle are inclusive of the left and top edges and exclusive of the right and bottom edges:

http://www.bbcbasic.co.uk/bbcwin/manual/bbcwin3.html#pixelsolid

Try changing all the 99's in your program to 100 and see if that gives the results you want.

If not, ask again.

Richard.
Re: Copying rectangles..
Post by afarlie on Oct 9th, 2013, 5:30pm

on Oct 9th, 2013, 3:06pm, Richard Russell wrote:
This section of the documentation says that graphics coordinates of a solid rectangle are inclusive of the left and top edges and exclusive of the right and bottom edges:

http://www.bbcbasic.co.uk/bbcwin/manual/bbcwin3.html#pixelsolid

Richard.


Problem solved.

BTW I will check the first example for sillies..smiley