home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!utcsri!torn!cunews!nrcnet0!emr1!jagrant
- From: jagrant@emr1.emr.ca (John Grant)
- Subject: fast image drawing like UNIRAS Gimage
- Message-ID: <1992Sep16.042818.4073@emr1.emr.ca>
- Organization: Energy, Mines, and Resources, Ottawa
- Date: Wed, 16 Sep 1992 04:28:18 GMT
- Lines: 37
-
- Background:
- Image display (i.e. BMP) is relatively straightforward: the file
- already contains colour values and there is a 1:1 correspondence
- between data cells & device pixels.
-
- But, suppose I have a file of N rows X M columns & each 'cell'
- contains a float value, i.e. temperature, elevation or any value
- which is usually contoured. Each cell represents an area on the
- ground of DX m X DY m square. The idea here is to display the
- file AT ANY SCALE and to map the float values to colours 'on the fly'.
-
- We do this now with UNIRAS raster software (GIMAGE) on VAXes with
- 36" Versatec/Synergy colour electrostatic plotters. Now I want
- to do the same thing in Windows (forget the plotters for now).
-
- I never did this in a DOS environment, because I didn't have
- dithered colours and 16 colours was insufficient.
-
- The program must be prepared to display the data cells at any scale
- to allow for zooming on the image. For example, a data cell of
- 250 m X 250 m may be 20 X 20 pixels, 200 X 200 pixels etc, depending
- on current scale.
-
- Conversion of the floating point numbers to a palette index or RGB
- value is simple - it is the drawing that is slow. I compute the 4
- co-ordinates of each data cell and use Rectangle to draw it with
- the indicated fill colour. For a 500 X 500 image, this requires
- 250,000 calls to Rectangle! It is slow. As for UNIRAS, I would
- hope the system to take care of cases where the scale forces
- the size of the data cell to be less than 1 pixel in size.
-
- Is there a faster or more efficient way? I looked at all of the
- of the 'blt' functions, but they don't seem to apply here. Should
- I draw it in memory and then BitBlt it onto the screen? That sounds
- pretty good.
-
- Please no ++ or OWL just yet - I'm still learning API.
-