jrn@csd4.csd.uwm.edu (James Ray Norton) (10/18/89)
Hi got a question: I am using Turbo Pascal V 5.0. And I am trying to set the RGB color palette by doing the following...... program TestColors(input, output); uses Graph, Crt; var Mode, Driver: integer; i,c: word; begin Mode:=VGAHI; Driver:=VGA; InitGraph(Drover, Mode, 'a:\'); for i:=1 to 16 do begin c:=(i*10)+40; SetRGBPalette(i,c,0,0); end; for i:=1 to 16 do PutPixel (i*20,200,i); end. Now, I would think that this should give me a bunch of points that are varying shades of Red.. But this is not so. It gives me points having the standard default colors.. Does anyone know what I am doing wrong? Any and all help would be greatly appreciated... Jim Norton jrn@csd4.csd.uwm.edu -- _______________________________________________________________________________ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ _ _ _ _ _ _ ' ) / ' ) / ' ) ) ) jrn@csd4.csd.uwm.edu
ncsmith@ndsuvax.UUCP (Timothy Lyle Smith) (10/19/89)
In article <503@uwm.edu> jrn@csd4.csd.uwm.edu (James Ray Norton) writes: > >Hi got a question: > >I am using Turbo Pascal V 5.0. And I am trying to set the RGB color palette >by doing the following...... > >begin > Mode:=VGAHI; > Driver:=VGA; > InitGraph(Drover, Mode, 'a:\'); [stuff about getting only the default colors] The problem here is that the range of colors in the VGAHI mode is only the default colors. The VGA standard allows 256 colors in the 320x200 mode only. I have seen your problem with other people so I can only assume that Borland did not allow the SetRGBPalette function to work in any other mode besides 320x200, this assumes that you have the over 256K of video memory that is needed to use more than 16 colors in the 640x480 mode. -- Tim Smith North Dakota State University, Fargo, ND 58105 UUCP: ...!uunet!ndsuvax!ncsmith | 90% of the people on this planet BITNET: ncsmith@ndsuvax.bitnet | are crazy and the rest of us are INTERNET: ncsmith@plains.NoDak.edu | in grave danger of contamination