home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / os / mswindo / programm / misc / 1864 < prev    next >
Encoding:
Text File  |  1992-09-15  |  2.0 KB  |  47 lines

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