Qbasicnews.com

Full Version: Loading Images
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
ok, I have the code for the pp256 tile loading, but i'm not really sure what makes it work, i want to know the logic behind it, also can a similar routine be used to load bmp,jpeg,png imagearrays?
ok, well I got this to work:

Code:
Screen 20,32,,1
Bload "tiledemo.bmp" ' file contains 2 images side by side
Redim TempGFX (1 to 2,80*60)
Get (0,0)-(79,59), TempGFX(1,60)
Get (80,0)-(159,59), TempGFX(2,60)

Do
For X = 1 to 2
Put (rnd*1024, rnd*768), TempGFX(x,60),Pset
Next
Sleep 1
Loop Until Inkey$=" "

It works but if I replace TempGFX(n,60) with TempGFX(n,0) or TempGFX(n,1) or TempGFX(n,2) I get an error upon exiting the program. My question is why does 60 work, or what other value should/could go there.
This one is a standalone pp256 image loader, abstracted or even am easier interface:

"pp256image.bi"

http://qh2.qbtk.com/520-d