Abducted Pixels
Moderators:Administrator, Global Moderator
Someone help me before I go insane; i dimension all my arrays with (width * height)/2 + 2 like I am supposed to, but whenever I BLOAD a tile I dimensioned in the same way, four pixels are missing at the bottom right, all along the bottom border. I'm going crazy with frustration trying to figure out why, and I don't think I'll last much longer. Please help.
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
The easiest way is to just paste the code in and highlight it. Then just hit the code tag up by the message title.
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!
I'm using 4.5, so it won't let me copy and paste to this window, and it won't open correctly on Notepad, is what I'm saying. I also tried opening on 1.1 and then opening THAT on Notepad, but to no avail. I've concluded, however, that all the problems lie in my file save/load system. I currently use BSAVE/BLOAD. Would Open...Close work better perhaps? If so, how would I use those commands with an array image?
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
To post your code on a message board:
While you are using QBasic, goto FILE, SAVE AS...
You will then see a FORMAT box. In that box, click on TEXT(readable by other programs)... that will save it in ASCII format, instead of BINARY.
Then you can open the file from notepad without getting all the strange binary characters.
QB 1.1 does not open binary files.
I would highly reccomend to use BLOAD to load images that were saved with BSAVE. They were meant to be used together. There ixs an example program in the QB online help file... You might wanna check it out.
Otherwise, If you want to write your own image loader, check this site out. It has the specs for just about every file format you could ask for.
http://www.wotsit.org/
Just look for what you want, take your time, try your best and post some code when you have a problem that you cannot solve.
While you are using QBasic, goto FILE, SAVE AS...
You will then see a FORMAT box. In that box, click on TEXT(readable by other programs)... that will save it in ASCII format, instead of BINARY.
Then you can open the file from notepad without getting all the strange binary characters.
QB 1.1 does not open binary files.
I would highly reccomend to use BLOAD to load images that were saved with BSAVE. They were meant to be used together. There ixs an example program in the QB online help file... You might wanna check it out.
Otherwise, If you want to write your own image loader, check this site out. It has the specs for just about every file format you could ask for.
http://www.wotsit.org/
Just look for what you want, take your time, try your best and post some code when you have a problem that you cannot solve.
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!
Question of interest, more than need. Answer only if you'd like to. Could I create a file for my array with open/close rather than bsave, and then save it the same way? If so, would I open as type binary? Then, how would I actually go about reading the array into BASIC? Remember, answer only if you wish. I was just curious.
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
Yeah, you could do it that way.
Assuming you have the image drawn in the upper left hand corner, you could do something like this...
See how it works?
Assuming you have the image drawn in the upper left hand corner, you could do something like this...
Code: Select all
'For SAVING
Open MyFile$ for Output as #1
For y=0 to imageheight
For x=0 to imagewidth
PixelColor$ = STR$(Point(X,Y))
Print #1, PixelColor$
Next
Next
Close #1
Code: Select all
'For LOADING
Open MyFile$ for Input as #1
For y=0 to imageheight
For x=0 to imagewidth
Input #1, PixelColor$
PSET(X,Y), VAL(PixelColor$)
Next
Next
Close #1
See how it works?
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!
-
- QBasic God
- Posts:166
- Joined:Tue Mar 25, 2003 12:45 am
- Location:U.S.A.
- Contact:
Newbie!!! You are a noob!!!!!!!!
Just kidding.
I think it changes with how long you've been a member, or how many posts you have made... or something.
Just kidding.
I think it changes with how long you've been a member, or how many posts you have made... or something.
Come check out [url=http://www.freebasic.net/forum/index.php]FreeBASIC[/url]. The syntax is based on QuickBasic, but it expands to use pointers, operator overloading, etc... The list goes on and on!