home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4764 < prev    next >
Encoding:
Text File  |  1993-01-08  |  2.4 KB  |  60 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. From: chris@chrism.demon.co.uk (Chris Marriott)
  3. Path: sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
  4. Subject: Re: How do I rotate text or a bitmap? 
  5. Distribution: world
  6. References: <1993Jan7.211926.11912@physics.ucla.edu>
  7. Organization: None
  8. Reply-To: chris@chrism.demon.co.uk
  9. X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
  10. Lines: 45
  11. Date: Fri, 8 Jan 1993 19:30:30 +0000
  12. Message-ID: <726521430snz@chrism.demon.co.uk>
  13. Sender: usenet@demon.co.uk
  14.  
  15. In article <1993Jan7.211926.11912@physics.ucla.edu> mmccarri@physics.ucla.edu writes:
  16.  
  17. >I could rotate a bitmap pixel by pixel, but it seems like a
  18. >lot of work given the various color formats.  Is there an
  19. >easier (and faster) way?
  20. >
  21.  
  22. Write your application under Win32s and use the "World Transforms" that
  23. Win32 gives you.  Rotation is then just as easy as translation and
  24. scaling now are.
  25.  
  26. >Speaking of bitmaps, I am drawing a large, multi-color bitmap
  27. >(a frequeny-time spectrogram) using the Rectangle() function
  28. >to fill in each df dt block.  This also seems like too much 
  29. >work since I have to create a pen and a brush with the desired
  30. >color, select these objects, draw the rectangle, and then delete
  31. >both objects.  This is repeated 100,000 times or so and is very
  32. >slow.  I experimented with the SetPixel() function instead, but
  33. >it is even slower!  Also, SetPixel() will not dither the color
  34. >if I am running on a paletteless display.  Any suggestions?
  35. >
  36.  
  37. 1.  Use PatBlt rather than Rectangle - it's a lot faster.
  38. 2.  Create all the brushes you need at the start, do the drawing,
  39.     then delete all the brushes at the end.
  40. 3.  SetPixel will *never* create a dithered colour, whether or not
  41.     the display is palette-based.
  42.  
  43. >Thanks,
  44. >-Mike-
  45. >-- 
  46. >Dr. Michael McCarrick                   UCLA Department of Physics
  47. >Plasma Physics Lab                              405 Hilgard Avenue
  48. >mmccarri@physics.ucla.edu                    Los Angeles, CA 90024
  49. >
  50.  
  51. Chris
  52. -- 
  53. --------------------------------------------------------------------------
  54. | Chris Marriott                           | chris@chrism.demon.co.uk    |
  55. | Warrington, UK                           | BIX: cmarriott              |
  56. | (Still awaiting inspiration              | CIX: cmarriott              |
  57. |  for a witty .sig .... )                 | CompuServe: 100113,1140     |
  58. --------------------------------------------------------------------------
  59.  
  60.