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