Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stupid graphics experiment
#1
I failed to come up with a quick example for the new third parameter of _LOADIMAGE(), didn't pay attention that the string is supposed to be just like one that could be loaded from JPEG, PNG, PCX etc. graphics file format. Enjoy this, it's my first successful experiment ever with _MEMCOPY. A good improvement is to change the palette, either as greyscale or along a cool gradient.

Code: (Select All)
'by mnrvovrfc 20-Feb-2023
DIM a$, b AS STRING * 256000
DIM AS INTEGER v, i, j
DIM AS LONG ascr, ctop, cbot
DIM amem AS _MEM, bmem AS _MEM

SCREEN _NEWIMAGE(640, 400, 256)
PRINT "Building screen, please wait..."

ctop = 1
cbot = 640 * 399 + 1
a$ = SPACE$(640)
b = SPACE$(256000)
FOR j = 1 TO 200
    FOR i = 1 TO 640
        IF i MOD 2 = 0 THEN
            MID$(a$, i, 1) = CHR$(150 + v + (i MOD 56))
        ELSE
            MID$(a$, i, 1) = CHR$(v + (i MOD 16))
        END IF
    NEXT
    MID$(b, ctop, 640) = a$
    MID$(b, cbot, 640) = a$
    ctop = ctop + 640
    cbot = cbot - 640
    v = v + 1
    IF v >= 50 THEN v = 0
NEXT

bmem = _MEM(b)
ascr = _COPYIMAGE(0)
amem = _MEMIMAGE(ascr)
_MEMCOPY bmem, bmem.OFFSET, bmem.SIZE TO amem, amem.OFFSET
_MEMFREE bmem
SCREEN ascr
SLEEP
SCREEN 0
_MEMFREE amem
SYSTEM
Reply


Messages In This Thread
Stupid graphics experiment - by mnrvovrfc - 02-20-2023, 07:38 AM
RE: Stupid graphics experiment - by mnrvovrfc - 02-20-2023, 08:18 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Star GPT-4o - BBOX Mouse States - Experiment with a diagram to hint at creation of code. grymmjack 10 2,519 08-10-2024, 04:36 PM
Last Post: Pete
  Double slit experiment vince 7 1,730 07-18-2024, 11:06 PM
Last Post: Pete
  Graphics doodling. James D Jarvis 3 964 05-02-2023, 02:58 PM
Last Post: bplus
  Just a little graphics demo James D Jarvis 2 813 09-21-2022, 08:32 PM
Last Post: James D Jarvis
  My old Turtle Graphics Fractals triggered 9 2,204 06-03-2022, 07:07 PM
Last Post: bplus

Forum Jump:


Users browsing this thread: 1 Guest(s)