
Need graphics expert! How to draw a large graphics image in memory?
Quote:
>> Need graphics expert! How to draw a large graphics image in memory?
>> How do I draw a large graphics image in memory (not on the
>> monitor screen) in 16 colors, about 1000 X 1000 pixel dots, and save
>> it as an uncompressed Windows .BMP image ?
>> Please reply here in newsgroup.
>> Thanks
>> RL
>You didn't specify just how you were rendering the imagery. I assume you
>mean using the built-in BASIC functions such as LINE, CIRCLE, etc.
That would be nice n easy but I'm also prepared to use my own line
and circle routines if need be.
Quote:
>There are a number of ways to go about it, depending on how advanced in
>programming you are and what speed requirements you have.
Not that advanced.
Quote:
>No matter which of the following suggestions you take, you will still need
>to write your own BMP writing routines. It's not really hard but it takes
>a little knowlege of binary file formats in general and some docs on BMP in
>particular (look on ftp://x2ftp.oulu.fi)
I dl'd quite a few BMP read/write routines, but it's still hard to
figure them out.
Quote:
>A more advanced method, but most efficient would be to actually code your
>own line/circle/etc. drawing routines and direct them to an array rather
>than the video memory.
I can't draw my image in video memory because I want the size to be
larger than 640X480, as I mentioned in my first post, it needs to be
1000 X 1000 pixel dots. So the drawing must be done to a disk file
(very slow) or to a file on a Ram Disk, which would be like writing
to extended RAM memory.
Quote:
> Unless you're using pointers in PowerBasic (or
>inline assembly) doing it this way is going to be very cumbersome and
>probably slow.
I use QuickBasic 4.5
Quote:
>A simpler method would be to select SCREEN 9, and render pieces of your
>image to the page that is not visible. Then you can use scan the area that
>you've rendered with POINT() and fill in the appropriate parts of your
>array (you'll need to do a litte bit-twiddling with AND, OR etc. since your
>array will hold more than one pixel per element (since in 16-color mode,
>you can hold two pixels in a single byte.)
>If you have the memory, I'd suggest actually just converting your image to
>8-bit (256-color) BMP since it will be much easier (and faster to convert.)
Sounds too complicated.
OK, forget the 1000 X 1000 size. What I would like to get help in is a
simple algorithm example of how to draw a couple of dots in a straight
line to a 40 X 40 pixel dot .bmp image, not in video screen memory,
but in a binary file on disk. If I know how to do that, then I can do
it on a larger scale in a file on Ram Disk, which would be very fast
on a Pentium. It's the "BIT/OR/AND" -writing routine that I need
for the .BMP format.
Still hoping and waiting for salvation...
R.L.