home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mswindo / programm / misc / 1429 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.4 KB

  1. From: azarian@hpcc01.corp.hp.com (Randy Azarian)
  2. Date: Fri, 21 Aug 1992 01:31:11 GMT
  3. Subject: GDI: Drawing a dotted line
  4. Message-ID: <70550002@hpcc01.corp.hp.com>
  5. Organization: the HP Corporate notes server
  6. Path: sparky!uunet!usc!sdd.hp.com!hpscdc!hplextra!hpcc05!hpcc01!azarian
  7. Newsgroups: comp.os.ms-windows.programmer.misc
  8. Lines: 27
  9.  
  10. I want to draw a line with alternating pixels; in other words, a dotted line.
  11. CreatePen provides a number of patterns that I am able to use, however what
  12. they call PS_DOT alternates about every two or three pixels, but not what I
  13. want, which is to alternate *every* pixel.
  14.  
  15. Realizing that CreatePen probably won't work for me, I created a bitmap 
  16. with alternating pixels (8x8) and used PatBlt to copy the bitmap (in a 
  17. single-line width) to the device.  This works, but it is way too slow.
  18.  
  19. I even tried using my own line-drawing algorthm and using SetPixel and
  20. alternating pixels.  This is even slower.
  21.  
  22. When I use LineTo with CreatePen, the results are almost instantaneous.
  23. With the other two methods I described, there is a *noticable* line trace.
  24.  
  25. Can anyone help me to find a way to draw a *true* dotted line ... fast and easy
  26. (well, easy is not so important, but fast is).  Possibly there is some way
  27. to modify an HPEN after I generated it using CreatePen.
  28.  
  29. I would think that this would be a common item to use.  
  30.  
  31.  
  32. Thanks for any help.
  33.  
  34. -------
  35. Randy Azarian
  36. HP PAITC 
  37.