3

im trying to load an image for my game title instead of ASCII, but when i try to load the image, it says that _PUTIMAGE, i&. 0 is an illegal function call. Does _PUTIMAGE,i& not work for certain file types?

I've tried all the ways the built-in help suggest i load an image, but none of them work.

menu:
CLS
PRINT
i& = _LOADIMAGE("FOrest.jpg")
_PUTIMAGE, i&
PRINT ""
PRINT "What Will Your Heros Name be?:";
Name$ = Ask$(5, 1, CSRLIN, POS(0), 11, 0)
CLS
check_1% = 0 'placeholder for debugingg
COLOR 15, 0
PRINT Name$ + "How Old will Your Hero be?: ";: age% = VAL(Ask$(3, 0, CSRLIN, POS(0), 15, 0))
'INPUT "", age%

i want this image to be loaded Game title image

eoredson
  • 1,167
  • 2
  • 14
  • 29
Patrick Coots
  • 301
  • 2
  • 10

4 Answers4

2

The sourceHandle& and destHandle& cannot be the same or an Illegal Function Call error will occur

Try specifying an explicit destination handle. You want the screen so select 0.

  • method 1

    i& = _LOADIMAGE("forest.jpg")
    _PUTIMAGE , i&, 0
    
  • method 2

    i& = _LOADIMAGE("forest.jpg")
    _SOURCE i&
    _DEST 0
    _PUTIMAGE
    

It would be best if you verified if loading the image was successful. Check if i& is less than -1.


Did you at least setup a graphics screen for your .jpg picture?

SCREEN 13
i& = _LOADIMAGE("forest.jpg")
_PUTIMAGE , i&, 0
Sep Roland
  • 33,889
  • 7
  • 43
  • 76
1

Are you in SCREEN 0 or in a graphics mode?

1

doing

SCREEN _NEWIMAGE(640, 480, 32) 
i = _LOADIMAGE("FOrest.jpg.png") 'this filename was the only one that worked
_PUTIMAGE (0, 0), i

worked but I cant do my other inputs i have at that point where the image loads. this was in the built in help but previously didnt work. so this is weird, i guess when it works it works

Patrick Coots
  • 301
  • 2
  • 10
0

Check if image was loaded correctly:

SCREEN _NEWIMAGE(640, 480, 32)
CLS , _RGB(0, 255, 0)
i& = _LOADIMAGE("FOREST.JPG")
IF i& = -1 THEN PRINT "invalid image": END
_PUTIMAGE (0, 0), i&, 0
END
eoredson
  • 1,167
  • 2
  • 14
  • 29