Help with DATA graphics

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

RayBritton
Veteran
Posts: 109
Joined: Thu Feb 10, 2005 12:38 pm

Help with DATA graphics

Post by RayBritton » Thu Feb 10, 2005 12:55 pm

If you do:

Code: Select all

DATA 01,01,01,01
DATA 01,00,00,01
DATA 01,00,00,01
DATA 01,01,01,01

FOR x = 1 TO 4
FOR x = 1 TO 4
READ z
PSET(x, y), z
NEXT
NEXT

DIM box(4*4)
GET (0, 0) - (4, 4), box
but i get a syntax error about the PSET(x, y), z
so i redid it but now i get a syntax about GET (0,0) - etc.

Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re » Thu Feb 10, 2005 3:13 pm

Code: Select all

DATA 01,01,01,01
DATA 01,00,00,01
DATA 01,00,00,01
DATA 01,01,01,01

SCREEN 13

FOR x = 1 TO 4
FOR x = 1 TO 4
READ z
PSET(x, y), z
NEXT
NEXT

DIM box(4*4)
GET (0, 0) - (4, 4), box 
You need to initialize graphics mode before you can do any graphics.

Is this QB or FB?
I have left this dump.

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Thu Feb 10, 2005 3:26 pm

:shock: Graphics mode or not, you messed it up in one spot. Your not reading to a Y cordinate,. The FOR.. NEXT contol reading time to cords X & Y,.. This is what you got..

Code: Select all

FOR x = 1 TO 4 
  FOR x = 1 TO 4 
    READ z 
    PSET(x, y), z 
  NEXT 
NEXT 
This is what you need to do,. look completely repaired code.

Code: Select all

DATA 01,01,01,01 
DATA 01,00,00,01 
DATA 01,00,00,01 
DATA 01,01,01,01 

SCREEN 13 

FOR y = 1 TO 4 ' You need to read Y
  FOR x = 1 TO 4 ' Then X, not just X
    READ z 
    PSET(x, y), z 
  NEXT 
NEXT 

DIM box(4*4) 
GET (0, 0) - (4, 4), box 
And make sure you read Y b4 X like I did above, and like Z!re said, you need it in SCREEN 13, or any graphic supporting screen, but 13 is the best... :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} » Thu Feb 10, 2005 3:35 pm

13? What about the new bigger modes thata Adugun A. Polack found?!
Image

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Thu Feb 10, 2005 3:40 pm

:) , Do any of them have 256 color pallet, I looked over what I could at the time and din't see any??

Hay Ray, There more post above this one, :wink: , Helpful ones too
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo » Thu Feb 10, 2005 3:50 pm

Ya Rattrap I saw that right away too....

You got here before me though....heh. :(

Oh well,
"But...It was so beutifully done"

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Thu Feb 10, 2005 3:55 pm

Yeah, Heh, I was looking for your post, but like you said, I got here first.. :wink: At least you got back up when it comes to helping other QBers tho,.
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo » Thu Feb 10, 2005 4:00 pm

hmmm.... :) .... :D ..... :lol:
"But...It was so beutifully done"

User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} » Thu Feb 10, 2005 5:38 pm

16 ATTRIBUTES and 256 COLORS! Lots of colors, little atts (like screen 12)!
Image

User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo » Thu Feb 10, 2005 9:51 pm

No I like 13 because of its 256 color ATTRIBUTES!!!

Helpful for those 3D programs (shading)....Lol :D
"But...It was so beutifully done"

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Thu Feb 10, 2005 10:13 pm

No, he's on some bigger modes a QBer over at QBNews found,. right inpressive.. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

RayBritton
Veteran
Posts: 109
Joined: Thu Feb 10, 2005 12:38 pm

Post by RayBritton » Fri Feb 11, 2005 12:32 am

thanks, the problem was i forgot to put it in a screen
the two xs wasn't in my code i typed it wrong
thanks again

User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo » Fri Feb 11, 2005 7:53 am

Welcome :D

Ummm Rattrap he discovered a new screen mode I thought there were only 14? :?
"But...It was so beutifully done"

Z!re
Veteran
Posts: 887
Joined: Wed Aug 04, 2004 11:15 am

Post by Z!re » Fri Feb 11, 2005 8:42 am

Change to freeBASIC:
SCREEN 21 = 1280x1024x8bit

Or just use SDL directly like I do, and get any resolution you want, with any bithdepth you want.
I have left this dump.

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Fri Feb 11, 2005 11:48 am

Z!re wrote:Change to freeBASIC:
SCREEN 21 = 1280x1024x8bit

Or just use SDL directly like I do, and get any resolution you want, with any bithdepth you want.
:D 21 :!: Thats how you get that screen!!

Crap, I've have a heck of a time with the SDL lib thing, or on the exapmle things, can't get it to go, or find 'em, what ever the error is.. I'll just stick with the 21 for now:wink:

:idea: Say, what the SCREEN for 800*600*8bit?? :?:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo » Fri Feb 11, 2005 3:09 pm

Holy crap that's what XP has!

hmm...aw.

I didn't know QB had a 21 SCREEN.....
"But...It was so beutifully done"

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Fri Feb 11, 2005 5:04 pm

:shock: NO!! We are on FREEBASIC!! :shock:

The new screens in QB are moded SCREEN 12 and another I think,. but no, SCREEN 21 is FreeBasic... :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo » Fri Feb 11, 2005 5:45 pm

Oh, I'm sorry....You know this is a QB site so I assumed that you were talking about QB...stupid thinking really...

Ummm...I don't know what you just said but QB has modes 0-14 last time I checked....
"But...It was so beutifully done"

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Fri Feb 11, 2005 6:49 pm

Here, Mitth, look at this...

http://forum.qbasicnews.com/viewtopic.p ... highlight=

Takes you to the thread with the new modes,.. :wink:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

User avatar
Mitth'raw'nuruodo
Veteran
Posts: 839
Joined: Sat Jan 22, 2005 11:04 am
Location: Eastern Coast of US
Contact:

Post by Mitth'raw'nuruodo » Fri Feb 11, 2005 7:08 pm

hmmm...confusing...very confusing...
"But...It was so beutifully done"

Post Reply