06-27-2023, 11:56 AM
(This post was last modified: 06-27-2023, 11:58 AM by TerryRitchie.)
You can do the painting right on the default screen or on a work screen.
Try not to think in terms of needing to paint the object. Many times I'll simply paint an entire work screen, draw my object, then paint OUTSIDE the object to get the effect I need. Code below shows a few examples:
Try not to think in terms of needing to paint the object. Many times I'll simply paint an entire work screen, draw my object, then paint OUTSIDE the object to get the effect I need. Code below shows a few examples:
Code: (Select All)
SCREEN _NEWIMAGE(1200, 820, 32)
' Do the painting on the default screen (_DEST 0)
CLS , _RGB32(255, 0, 0) ' paint the entire screen first
DIM colr AS _UNSIGNED LONG: colr = _RGB(255, 0, 0)
colr = _RGB(0, 255, 255)
PSET (500, 300): DRAW "C" + STR$(colr) + "R100F100D100G100L100H100U100E100"
PAINT (0, 0), _RGB32(0, 0, 0), colr ' paint the screen black until cyan is met
SLEEP
' Do the painting on a work screen that gets copied to the default screen.
CLS
PRINT
PRINT " This is the default screen _DEST 0"
PRINT " The work screen will not wipe this text out"
WorkScreen& = _NEWIMAGE(1200, 820, 32)
_DEST WorkScreen& ' all graphics command sent to work screen
CLS , _RGB32(255, 0, 0) ' paint the entire work screen first
PSET (500, 300): DRAW "C" + STR$(colr) + "R100F100D100G100L100H100U100E100"
PAINT (0, 0), _RGB32(0, 0, 0), colr ' paint the work screen black until colr met
_CLEARCOLOR _RGB32(0, 0, 0) ' make black on the work screen transparent
_DEST 0 ' go back to default screen
_PUTIMAGE , WorkScreen&, 0 ' copy the work screen to the default screen