home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / os2 / programm / 6289 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.3 KB  |  36 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!mcsun!news.funet.fi!aton.abo.fi!usenet
  3. From: PNIELSEN@finabo.abo.fi (Peter Nielsen)
  4. Subject: Overriding system colors (Using 256 distinct colors)
  5. Message-ID: <1992Nov8.195236.1537@abo.fi>
  6. Sender: usenet@abo.fi (Usenet NEWS)
  7. Organization: Abo Akademi University, Finland
  8. Date: Sun, 8 Nov 1992 19:52:36 GMT
  9. X-News-Reader: VMS NEWS 1.23
  10. Lines: 24
  11.  
  12. Subject: Using all colors in a 256-color palette (Overriding system colors)
  13.  
  14. In OS/2 v1.3 I have used this code, which works well:
  15.  
  16.     GpiCreateLogColorTable (hpsMemory, LCOL_REALIZABLE, LCOLF_CONSECRGB, 
  17.                             0L, 256L, (PULONG)&pal[0]);
  18.     GpiRealizeColorTable (hpsMemory);
  19.  
  20. Since OS/2 v2.0 does not provide the GpiRealizeColorTable function I have tried 
  21. to use the GpiCreatePalette function with the LCOL_OVERRIDE_DEFAULT_COLORS 
  22. option. This option causes GpiCreatePalette to return the error message 
  23. PMERR_INV_COLOR_OPTIONS. This is the v2.0 code:
  24.  
  25.     hpal = GpiCreatePalette (hab, LCOL_OVERRIDE_DEFAULT_COLORS, 
  26.                              LCOLF_CONSECRGB, 256L, (PULONG)ppal);
  27.     GpiSelectPalette (hpsMemory, hpal);
  28.     WinRealizePalette (hwnd, hpsMemory, &numcol);
  29.  
  30. What am I doing wrong ? I am grateful if someone could provide a solution to
  31. this problem. I use an XGA display adapter.
  32.  
  33. Peter Nielsen
  34.  
  35. EMAIL: pnielsen@ra.abo.fi
  36.