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 »

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 »

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.
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

: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} »

13? What about the new bigger modes thata Adugun A. Polack found?!
Image
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

:) , 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 »

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

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

Oh well,
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

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 »

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} »

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 »

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

Helpful for those 3D programs (shading)....Lol :D
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

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 »

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 »

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 »

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.
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

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 »

Holy crap that's what XP has!

hmm...aw.

I didn't know QB had a 21 SCREEN.....
"But...It was so beutifully done"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

: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 »

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"
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 »

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 »

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