home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.msdos.programmer
- Path: sparky!uunet!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sun4nl!rulway.LeidenUniv.nl!rullf2!vdkamp
- From: vdkamp@rullf2.leidenuniv.nl
- Subject: TP60 graphic question
- Message-ID: <1992Nov6.140322.1@rullf2.leidenuniv.nl>
- Lines: 53
- Sender: news@rulway.LeidenUniv.nl (Usenet news account)
- Nntp-Posting-Host: rullf2
- Organization: Leiden University, Medical Informatics
- Date: 6 Nov 92 14:03:22 +0100
-
-
- Dear everybody with Borland Turbo experience,
-
-
- We've got difficulties to define a problem with Turbo Pascal 6.0.
-
- As we wanted to invert colors in an application from white on black to
- black on white we met the following curiosity:
-
- If we made the background color white (SetRGBPalette(0,r,g,b)) and the
- foreground color black (same method) we could not invert (NOTPUT) the
- background anymore.
-
- So in a small program:
-
- Uses Graph;
-
- Var Gd,Gm :Integer;
- Size :Word;
- P :Pointer;
-
- Begin
- DetectGraph(Gd,Gm);
- InitGraph(Gd,Gm,'C:\TP60\BGI'); (* Be sure BGI driver is there *)
- SetBkColor(Black);
- SetColor(White);
- SetRGBPalette(Black,255,255,255); (* We are using VGA 256color *)
- SetRGBPalette(White,0,0,0); (* tested also 16 color *)
- (************************************************************************
- If you use next two lines instead of the 2 above this remark it works !
- SetPalette(Black,White);
- SetPalette(White,Black);
- ************************************************************************)
- Size := ImageSize(10,20,30,40);
- GetMem(P, Size);
- GetImage(10,20,30,40,P^);
- PutImage(10, 30, P^, NotPut);
- readln;
- CloseGraph;
- End.
-
-
- Result of this program is a nice white screen. Can anybody explain us
- why? I suggest E-MAIL Reply.
-
- I want to thank everybody in advance for her/his reply.
-
- B. van der Kamp. VDKAMP@Rullf2.leidenUniv.nl
- M.J. Roessen
- Acad. Hospital Leiden
- Leiden University
- Netherlands
-
-