home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15424 < prev    next >
Encoding:
Text File  |  1992-09-13  |  1.7 KB  |  46 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!spool.mu.edu!umn.edu!mmm.serc.3m.com!us277614
  3. From: us277614@mmm.serc.3m.com (Dave T. Berquist)
  4. Subject: Re: LockPixels() before every CopyBits()?
  5. Message-ID: <1992Sep13.223955.17262@mmm.serc.3m.com>
  6. Organization: 3M Company
  7. References: <1992Sep11.213220.23039@alias.com> <1992Sep12.232233.4076@desire.wright.edu>
  8. Date: Sun, 13 Sep 92 22:39:55 GMT
  9. Lines: 35
  10.  
  11. In article <1992Sep12.232233.4076@desire.wright.edu> jmatthews@desire.wright.edu writes:
  12. >> Assuming that the address is okay, I noticed that we don't call
  13. >> LockPixels() before CopyBits().  After inserting calls to LockPixels()
  14. >> and UnlockPixels(), it looks something like this:
  15. >> 
  16. >>     HLock((Handle) pixHandle1);
  17. >>     HLock((Handle) pixHandle2);
  18. >>     LockPixels(pixHandle1);
  19. >>     LockPixels(pixHandle2);
  20. >>     CopyBits((BitMap *)*pixHandle1, (BitMap *)*pixHandle2, ...);
  21. >>     UnlockPixels(pixHandle2);
  22. >>     UnlockPixels(pixHandle1);
  23. >>     HUnlock((Handle) pixHandle2);
  24. >>     HUnlock((Handle) pixHandle1);
  25. >> 
  26. >> Now this seems to be a bit much for every call to CopyBits.
  27. >
  28. >LockPixels and UnlockPixels should be suffucient; the HLock and
  29. >HUnlock aren't needed. I think you may need to be calling
  30. >GetGWorldPixMap instead of getting the pixMap directly (except
  31. >under ColorQD version 1.2 where it's broken (see the Q & A stack)).
  32. >
  33. >IM VI just says use GetGWorldPixMap without much explanation. I've
  34. >imagined this makes a difference with GWorlds on graphic accelerators
  35. >or temporary memory, but I don't really know.
  36. >
  37. >Any thoughts?
  38. >
  39.  
  40. GetGWorldPixMap should be used if system 7 is available, otherwise get
  41. the pixmap right from the gworld for system 6.  (GetGWorldPixMap does
  42. not work under system 6 - I know, I have tried it).
  43.  
  44. - Dave Berquist
  45.  
  46.