Qbasicnews.com
September 28, 2021, 01:25:16 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Drawing on the Array to be PUT  (Read 1945 times)
torstum
Member
*
Posts: 62


« on: June 24, 2006, 10:44:38 AM »

This is probably trivial to the veterans, but I've been thinking about manipulating directly the (sprite ) array before it gets PUT. Does anyone use this technique to draw lines, squares, shapes on screen? Is it faster this way, or is it slower because QBasic lacks high-level bitwise operations (am I wrong?)? I will have to have a good understanding of the QBasic image file format, though.
Logged
Anonymous
Guest
« Reply #1 on: June 24, 2006, 10:14:20 PM »

the image is stored like this

first 2 bytes = width * 8
next 2 bytes = height

rest data = one byte per pixel (8-bit)

thats why the size (in 16-bit integers) is ((w * h ) / 2) + 2 Wink
Logged
torstum
Member
*
Posts: 62


« Reply #2 on: June 25, 2006, 11:56:50 PM »

Chaos, 1 byte per pixel is for VGA, but isn't it 4 bits (16 colors) per pixel for EGA?
Logged
Anonymous
Guest
« Reply #3 on: June 26, 2006, 12:22:35 AM »

No idea. You'd have to be high to use EGA, it's 2006 =)
Logged
RyanKelly
Forum Regular
**
Posts: 109



WWW
« Reply #4 on: June 26, 2006, 09:12:57 PM »

Quote from: "torstum"
Chaos, 1 byte per pixel is for VGA, but isn't it 4 bits (16 colors) per pixel for EGA?


Most VGA modes resemble the EGA modes in that respect.  The 256 color mode is only VGA mode with 8 bit pixel data.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!