home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10381 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.9 KB  |  65 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sun4nl!rulway.LeidenUniv.nl!rullf2!vdkamp
  3. From: vdkamp@rullf2.leidenuniv.nl
  4. Subject: TP60 graphic question
  5. Message-ID: <1992Nov6.140322.1@rullf2.leidenuniv.nl>
  6. Lines: 53
  7. Sender: news@rulway.LeidenUniv.nl (Usenet news account)
  8. Nntp-Posting-Host: rullf2
  9. Organization: Leiden University, Medical Informatics
  10. Date: 6 Nov 92 14:03:22 +0100
  11.  
  12.  
  13. Dear everybody with Borland Turbo experience,
  14.  
  15.  
  16. We've got difficulties to define a problem with Turbo Pascal 6.0.
  17.  
  18. As we wanted to invert colors in an application from white on black to
  19. black on white we met the following curiosity:
  20.  
  21. If we made the background color white (SetRGBPalette(0,r,g,b)) and the
  22. foreground color black (same method) we could not invert (NOTPUT) the
  23. background anymore.
  24.  
  25. So in a small program:
  26.  
  27. Uses Graph;
  28.  
  29. Var Gd,Gm :Integer;
  30.     Size  :Word;
  31.     P     :Pointer;
  32.  
  33. Begin
  34.   DetectGraph(Gd,Gm);
  35.   InitGraph(Gd,Gm,'C:\TP60\BGI');    (* Be sure BGI driver is there *)
  36.   SetBkColor(Black);
  37.   SetColor(White);
  38.   SetRGBPalette(Black,255,255,255);  (* We are using VGA 256color *)
  39.   SetRGBPalette(White,0,0,0);        (* tested also 16 color *)
  40. (************************************************************************
  41.   If you use next two lines instead of the 2 above this remark it works !
  42.   SetPalette(Black,White);
  43.   SetPalette(White,Black);
  44. ************************************************************************)
  45.   Size := ImageSize(10,20,30,40);
  46.   GetMem(P, Size);
  47.   GetImage(10,20,30,40,P^);
  48.   PutImage(10, 30, P^, NotPut);
  49.   readln;
  50.   CloseGraph;
  51. End.
  52.  
  53.  
  54. Result of this program is a nice white screen. Can anybody explain us
  55. why? I suggest E-MAIL Reply.
  56.  
  57. I want to thank everybody in advance for her/his reply.
  58.  
  59. B. van der Kamp.   VDKAMP@Rullf2.leidenUniv.nl
  60. M.J. Roessen
  61. Acad. Hospital Leiden
  62. Leiden University
  63. Netherlands
  64.  
  65.