Need graphics expert! How to draw a large graphics image in memory? 
Author Message
 Need graphics expert! How to draw a large graphics image in memory?

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



Fri, 17 Mar 2000 03:00:00 GMT  
 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 ?

You're going to need about .5M for you 'image'. You may want to think about
using a file. You _could_ create a RamDisk to make work faster.

  ____    _    ____      ____  _____
 |  _ \  / \  / ___) __ | ___)(_   _)
 | |_)  / _ \ \____\/  \|  _)   | |
 |____//_/ \_\(____/\__/|_|     |_|

     www.basicguru.com/schullian



Fri, 17 Mar 2000 03:00:00 GMT  
 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.

There are a number of ways to go about it, depending on how advanced in
programming you are and what speed requirements you have.

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)

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.  Unless you're using pointers in powerbasic (or
inline assembly) doing it this way is going to be very cumbersome and
probably slow.

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.)

Either way this method will be painfully slow even on super-fast Pentiums
due to the fact that reading from video memory is one of the slowest
functions on just about all graphics cards.



Sat, 18 Mar 2000 03:00:00 GMT  
 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.



Fri, 24 Mar 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to save my drawing graphic as image???i did load from image

2. Speed problems with drawing large graphics

3. Help! Speed problems with drawing large graphics

4. Drawing graphics in memory

5. Graphics Processing On LARGE Images

6. Drawing functions(formulas) to draw graphics Like Fxtools.vbx

7. Need Source for graphics/images on toolbar buttons?

8. Need Control or DLL to save images in many different graphic formats

9. Graphics Experts - Please Help: Storing A BMP into Memroy

10. Drawing/Graphics

11. Draw graphics on Form Load

12. Draw graphics on mdi form

 

 
Powered by phpBB® Forum Software