gray scale lines in qbasic

January 19, 2013 at 12:49:03
Specs: Windows XP
I want to convert z axis values in a raster drawing to gray scale values to produce a
gray scale image.Can I do this in Qbasic?
I suspect that the graphics board in my computor has registers that may need addressing to enable gray scaling.
Regards Graham

See More: gray scale lines in qbasic

Report •

January 19, 2013 at 13:20:46
I'm not a student of graphics formats or digital imaging, so I will say right off that I don't have a clue, from what you've said. Maybe some more information might help. How is this drawing stored (binary, or a textual data-set)? And a sample of the data or binary elements that need to be converted, and what said conversion consists of. Maybe someone here can help with this, but I'm sorry to say I probably can't. The more information you can give, the more likely that something useful will turn up. You might also want to post this under "digital photo/video" forum. You might just need some good imaging software like photoshop or paint-shop pro etc.

Report •

January 19, 2013 at 15:45:36
HI nbrane,
Thanks for the reply.
The data is in the format X0.0000Y0.0000Z-0.0000
I can extract the X , Y & Z values.
The Z values I can scale to 0 -255 to give gray scale value to say PSET(X,Y),color
The problem is that I can't set the COLOR to the gray scale Z values in QBASIC
I have weighted the Z values to fit in the standard color set and I get a colour layered image ..not quite what I want though.
I have a preference for QBASIC based on its overall usefulness so that is why I am persisting in this exercise.

Regards GMS

Report •

January 19, 2013 at 19:36:32
Sorry for another non-answer, but since you have some code written, can you post it?
(Plus a sample of data you're trying to convert. What type of image file are you processing? It might be the imagefile format that's throwing you.)
Maybe I can work with it. I still use qbasic for some things but have never used its graphics functions.
ps: google gave me:
So breaking your color value into three values should yield the grayscale value you want. (google: "color grayscale formula")
But, I figure you already know this stuff anyway...

Report •
Related Solutions

Ask Question