home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / windows / x / 20723 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  2.5 KB

  1. Path: sparky!uunet!lhdsy1!kato.lahabra.chevron.com!hwrvo
  2. From: hwrvo@kato.lahabra.chevron.com (W.R. Volz)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: An Open Challenge (it can't be done!)
  5. Keywords: xor cursors images biscuits
  6. Message-ID: <8915@lhdsy1.lahabra.chevron.com>
  7. Date: 4 Jan 93 17:37:33 GMT
  8. References: <78716@hydra.gatech.EDU>
  9. Sender: news@lhdsy1.lahabra.chevron.com
  10. Organization: Chevron Oil Field Research Company
  11. Lines: 45
  12.  
  13. In article <78716@hydra.gatech.EDU>, gt4417a@prism.gatech.EDU (SKELTON,JOEL PHILLIP) writes:
  14. |> 
  15. |> After much thought I've gloomily concluded that nothing short
  16. |> of a (unacceptable to our application) server extension will
  17. |> give me quickly 'eraseable' diagonal lines on top of an image drawn
  18. |> to an X window. I now challenge (nay, beg) someone to prove me wrong.
  19. |> 
  20. |> Here's the short form:
  21. |>  - 8 bit image in backing pixmap used to update window
  22. |>  - Image drawn in 8 bit X window
  23. |>  - Want to draw diagonal lines on top of image that can
  24. |>    be removed quickly (i.e. replace them with the data they so
  25. |>    recently covered)
  26. |>  - Can't do server extensions (too many platforms to support)
  27. |> 
  28. |> 
  29. |> Betcha can't do it!
  30. |> 
  31.  
  32. Yes it can be done. I've done it. I also need to draw on images like
  33. yours. They are seismic data and the data is somewhat random. What I
  34. did to draw arbitrary lines is to save the contents under the line. 
  35. As you say, if the line is horizontal or vertical it's easy. The problem
  36. is that a diagonal line needs to store all the data defined by the
  37. the diagonal which grows in size as the line becomes longer of closer
  38. to a 45 deg angle. This will cause the speed to slow down as the much larger
  39. image areas are drawn. So I divide up the line into small segments and
  40. save that area. I compute the optimum size of the box to make image transfer
  41. fast (there is a tradeoff between the size of the division and the number
  42. of calls to the server to get the data - making the size too small causes
  43. more calls to the server thus slowing the pgm, making the size larger
  44. makes the size of the returned image larger also slowing the pgm). I 
  45. have to save a list of small images for each line I draw, but thats not
  46. too hard. The performance is acceptable. I had to add a fudge factor in
  47. the size of the box to account for lines wider than one pixel and for
  48. the stairstepping of the diagonal line. Hope that helps.
  49.  
  50. -- 
  51.  
  52. ======================
  53. Bill Volz
  54. Chevron Oil Field Research Co.
  55. Exploration Research/Geophysics Division.
  56. P.O. Box 446, La Habra, CA 90633-0446
  57. Phone: (310) 694-9340
  58.