home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3231 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: astfgl.idb.hist.no!not-for-mail
  2. From: anneu@colargol.idb.hist.no (Anne Kristine Ugedal)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: SetRGB32() doesn't do what it should...
  5. Date: 9 Feb 1996 09:46:04 GMT
  6. Organization: Sor-Trondelag College, Norway
  7. Message-ID: <4ff54s$pal@astfgl.idb.hist.no>
  8. References: <425.6611T1194T2896@ulysses.sax.de>
  9. NNTP-Posting-Host: colargol.idb.hist.no
  10. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  11.  
  12. Robby Paehlig (robby@ulysses.sax.de) wrote:
  13. : Here are some lines, that should change color 8 of my Workbench to blue:
  14. : [...]
  15. : if(GfxBase = (struct GfxBase *)(OpenLibrary("graphics.library", 39L))) {
  16. :     if(wb = LockPubScreen("Workbench")) {
  17. :         SetRGB32(&(wb->ViewPort), 8, 0x0ul, 0x0ul, 0xFFul);
  18. : [...]
  19. : Well, the color changes -- not to blue, but to black! What I'm doing wrong?
  20.  
  21. The 8-bit value that you supplies are placed in the least significant part
  22. of the 32-bit long that's used for RGB-values. You'll have to shift
  23. the bits upwards a bit, 24 bits to be exact, like this:
  24.  
  25. #define RGBSHIFT(a) ((a) << 24)
  26. SetRGB32(&(wb->ViewPort), 8, RGBSHIFT(0x0ul), RGBSHIFT(0x0ul), RGBSHIFT(0xFFul));
  27.  
  28. -- 
  29. * Anne Kristine Ugedal               *** Win.HLP AS, Norway - my employer *
  30. ** Spare time Amiga developer         *** Office time Windows developer. **
  31. *** anneu@colargol.idb.hist.no         *** anne@winhlp.no               ***
  32. **** http://colargol.idb.hist.no/~anneu *** http://www.winhlp.no       ****
  33.