02-13-2023, 01:30 PM
(02-13-2023, 12:10 PM)johannhowitzer Wrote: It also introduces a limitation, since it means the source coordinates can't be used, meaning hardware images can only be drawn in entirety, not pieces of them
at a time.
You can draw pieces of a hardware image onto the display. Let me give a very simple demo:
Code: (Select All)
SCREEN _NEWIMAGE(800, 600, 32)
RANDOMIZE TIMER
FOR i = 1 TO 100
LINE (RND * _WIDTH, RND * _HEIGHT)-(RND * _WIDTH, RND * _HEIGHT), _RGB32(RND * 256, RND * 256, RND * 256), BF
NEXT
hw = _COPYIMAGE(0, 33)
CLS , 0
x = RND * _WIDTH
y = RND * _HEIGHT
xMove = RND * 3 - 2
yMove = RND * 3 - 2
xsize = 400
ysize = 300
sizechange = 1
_DISPLAYORDER _HARDWARE
DO
_PUTIMAGE (x, y)-(xsize, ysize), hw, , (x, y)-(xsize, ysize)
_DISPLAY
_LIMIT 120
x = x + xMove
y = y + yMove
xsize = xsize + sizechange
ysize = ysize + sizechange
IF x < 0 OR x > _WIDTH THEN xMove = -xMove
IF y < 0 OR y > _HEIGHT THEN yMove = -yMove
IF ysize < 0 OR ysize > _WIDTH THEN sizechange = -sizechange
LOOP UNTIL _KEYHIT