home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 7871 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  2.9 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!pc110-02.insa-lyon.fr!ppollet
  2. From: ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: 2 Questions about Graphic under TurboPascal6
  5. Date: Tue, 5 Jan 1993 17:28:13 GMT
  6. Organization: INSA  CENTRE INFORMATIQUE DU 1er CYCLE
  7. Lines: 69
  8. Message-ID: <ppollet.117.726254893@cismibm.univ-lyon1.fr>
  9. References: <1993Jan4.225959.311@sinus.stgt.sub.org>
  10. NNTP-Posting-Host: pc110-02.insa-lyon.fr
  11.  
  12. In article <1993Jan4.225959.311@sinus.stgt.sub.org> stefan@sinus.stgt.sub.org (Stefan Bechtold) writes:
  13. >From: stefan@sinus.stgt.sub.org (Stefan Bechtold)
  14. >Subject: 2 Questions about Graphic under TurboPascal6
  15. >Date: Mon, 4 Jan 1993 22:59:59 GMT
  16.  
  17. >Hi !
  18.  
  19. >I've two questions about the graphic mode under Turbo Pascal 6.0:
  20.  
  21. >1) What I want to do is to move a rectangle on the screen;
  22. >   How can I do this ? If I use, e.g., a 
  23. >   for i:=1 to 10 do
  24. >   rectangle(i,i,4*i,4*i)
  25. >   I get 10 rectangles drawn together; but what I want is that
  26. >   they only appear for a certain time and then get removed
  27. >   (so that is appear as if the rectangle would move from i,i to
  28. >   10*i,10*i).
  29.  
  30.  
  31.     Works in XOR mode : 
  32.     When you draw an object twice in XorMode it restores the part
  33.     of the screen it was on :
  34.  
  35.       Something like: (by memory check for mispellings !)
  36.  
  37.         SetWritemode(XORPUT);
  38.         For I:= 1 to 10 do
  39.           begin
  40.             Rectangle(I,I,I*10,I*10);  (* draw it once *)
  41.             Delay (10);                (*wait a bit *) 
  42.             If I <>10 then              
  43.               Rectangle (I,I,I*10,I*10)   (*erase it if not a last 
  44. position*)    
  45.        end;    
  46.            
  47.     
  48.  
  49.  
  50. >2) I'm working on a program which often redraws the screen.
  51. >   Is there any possiblity to clear only certain figures/parts
  52. >   of the screen so that others remain on the screen ?
  53. >   (I've a matrix and something writen on that; what I want is that
  54. >   the matrix remains on the screen and only the other stuff will
  55. >   be rewritten)
  56.  
  57.    By playing with SetViewport(),ClearViewport() you should be able to
  58.     selectiveley erase some rectangular aera of the screen 
  59.    There is an example at ClearViewport entry in the TP6 programmer
  60.    reference manual 
  61.  
  62.  
  63.  
  64. >Thank you very much,
  65. >Stefan
  66. >-- 
  67. >+ Stefan Bechtold # stefanb@delos.stgt.sub.org # Voice +49 711 813240 +
  68. >++++++++sed nemo potuit tangere: merda fuit ! (Martial III 17)+++++++++
  69.  
  70. ppollet@cismibm.univ-lyon1.fr (Patrick POLLET)
  71. --------------------------------------------------------
  72. Dr Patrick L.Pollet
  73. Institut National des Sciences Appliquees
  74. Centre Informatique du 1er Cycle  Bat 110
  75. 20 Avenue A.Einstein
  76. 69621 Villeurbanne Cedex France
  77. --------------------------------------------------------
  78. Phone: 72 43 83 80 -   la premiere erreur c'est
  79. Fax  : 72 43 85 33 -   de se lever le matin  ... GASTON
  80. -------------------------------------------------------
  81.