Usually post most of my snippets on the CurvedBasic website, but I thought this one was worthy of being posted here. Basically the Imager Parser gets the color of each pixel on the screen and then saves it to an array. The Loader then takes that data and displays it on screen.
This really isn't the fastest way to display images (compared to load image), but I had fun creating it and would like to share it with you. Besides, you can now send secret messages through images now and no one but you and your friends will be able to see them.
The Image Parser
sync on : sync rate 60
set display mode 800,600,32
dim Picture(800,600)
`Load whatever image you want here.
load image "test.bmp",1
do
paste image 1,0,0
RGBcolour=POint(mousex(),mousey())
set cursor 0,0
print RGBcolour
`[=============================================]
`[============Saving the Image Data============]
`[=============================================]
if returnkey()=1
input name$
if name$="" then name$="NO NAME"
set dir "Pictures"
cls
paste image 1,0,0
for a = 1 to 800
for b = 1 to 600
X=POint(a,b)
Picture(a,b)=X
next a
next b
Save array name$,Picture(800,600)
do
cls
text 0,480,"DONE- Press any key"
wait key
goto endi
loop
endi:
endif
`[=============================================]
`[============Saving the Image Data============]
`[=============================================]
sync
loop
Loader
sync on : sync rate 60
set display mode 800,600,32
`Set the directory for where the image exists
set dir "Pictures"
dim Picture(800,600)
load array "test",Picture(800,600)
`Get the data from the array
for a = 1 to 800
for b = 1 to 600
dot a,b,Picture(a,b)
next a
next b
`Get the image
get image 1,0,0,800,600
do
`Paste the image to make sure it came up.
paste image 1,0,0
`If you want, from here you can use the 'Save Image' command
`to make a bitmap or whatever.
sync
loop
A book? I hate book. Book is stupid.
(Formerly known as Yellow)