r/qbasic • • Oct 11 '26

Image display code not working.

I was following a qb64 tutorial on how to display images. I converted the code listed as a .exe file and ran it and a popup appeared saying "Unhandled Error #5", "Line: 6 (in main module) Illegal function call". And then the code doesn't work.

The code in question:

Dim image As Long

Screen _NewImage(640, 400, 12)

image = _LoadImage("test.bmp")

_PutImage (100, 100), image

Is there anything I did wrong? I'm stumped.

1 Upvotes

2 comments sorted by

1

u/CharlieJV13 Oct 12 '26

I'm not a QB64 programmer. You might want to check out the related documentation for QB64PE (Phoenix Edition) https://qb64phoenix.com/qb64wiki/index.php/PUTIMAGE

1

u/Floamorpg QB64 Oct 14 '26

The image.bmp file must be in the same folder where the .exe is generated—another thing you could try is using the .png format for the image...