home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / PROGRAMM / FGL112B.ZIP / USER10.DOC < prev    next >
Text File  |  1992-10-05  |  25KB  |  617 lines

  1.  
  2.  
  3. Chapter 10
  4.  
  5. Animation Techniques
  6. 188  Fastgraph User's Guide
  7.  
  8. Overview
  9.  
  10.      Unlike other microcomputers, the IBM PC and PS/2 family of systems do
  11. not have any special graphics hardware or firmware to help in performing
  12. animation.  This means that any animation done on these systems must be
  13. implemented entirely through software.  This chapter will describe how to do
  14. this using Fastgraph's video page management and image management routines.
  15. The methods described in this chapter are not intended to be all inclusive,
  16. for that would itself fill a separate volume at least as large as this
  17. manual.  However, the animation techniques presented here should provide a
  18. basis that you can readily extend to develop more sophisticated uses of
  19. animation.  The examples in this chapter are restricted to graphics video
  20. modes.
  21.  
  22.  
  23. Simple Animation
  24.  
  25.      The first type of animation we'll examine is called simple animation.
  26. In simple animation, we display an object, erase it, and then display it in a
  27. new position.  When we perform this "erase and redisplay" sequence
  28. repetitively, the object moves.  This method, however, has two drawbacks.
  29. First, unless the object is rather small, it will flicker because the erasing
  30. and display of the object does not coincide with the refresh rate of the
  31. video display.  Second, and perhaps more importantly, anything underneath the
  32. object is not saved as the object moves across it.  Despite these
  33. limitations, simple animation is sometimes useful, and it is a good place to
  34. begin our discussion of animation techniques.
  35.  
  36.      Example 10-1 moves a small bright green rectangle (magenta in CGA) from
  37. left to right across the screen in any 320 by 200 color graphics mode.  The
  38. program moves the rectangle, 20 pixels wide and 10 pixels high, using a for
  39. loop.  This loop first uses the fg_clprect routine to display the rectangle,
  40. then uses the fg_waitfor routine to leave the object on the screen
  41. momentarily, and finally uses fg_clprect again to erase the rectangle by
  42. redisplaying it in the original background color (the fg_waitfor routine is
  43. described in Chapter 14).  We use fg_clprect rather than fg_rect because the
  44. first few and last few loop iterations result in at least part of the
  45. rectangle being off the screen.  Each successive loop iteration displays the
  46. rectangle five pixels to the right of its previous position.
  47.  
  48.                                 Example 10-1.
  49.  
  50.           #include <fastgraf.h>
  51.           #include <stdio.h>
  52.           #include <stdlib.h>
  53.           void main(void);
  54.  
  55.           void main()
  56.           {
  57.              int new_mode, old_mode;
  58.              int x;
  59.  
  60.              /* initialize the video environment */
  61.  
  62.              new_mode = fg_bestmode(320,200,1);
  63.              if (new_mode < 0 || new_mode == 12) {
  64.  
  65.                                         Chapter 10:  Animation Techniques  189
  66.  
  67.                 printf("This program requires a 320 ");
  68.                 printf("x 200 color graphics mode.\n");
  69.                 exit(1);
  70.                 }
  71.              old_mode = fg_getmode();
  72.              fg_setmode(new_mode);
  73.  
  74.              /* move the object across the screen */
  75.  
  76.              for (x = -20; x < 320; x+=5) {
  77.                 fg_setcolor(10);
  78.                 fg_clprect(x,x+19,95,104);
  79.                 fg_waitfor(1);
  80.                 fg_setcolor(0);
  81.                 fg_clprect(x,x+19,95,104);
  82.                 }
  83.  
  84.              /* restore the original video mode and return to DOS */
  85.  
  86.              fg_setmode(old_mode);
  87.              fg_reset();
  88.           }
  89.  
  90.      Example 10-2 is the same as example 10-1, but it shows what happens when
  91. we move the rectangle across an existing background (in this case, the
  92. background is solid white).  If you run this program, you'll see that the
  93. rectangle leaves a trail of color 0 behind it.  While this might be
  94. occasionally useful, it demonstrates that simple animation is destructive
  95. because it does not preserve the background.  In this example, if we changed
  96. the second call to fg_setcolor within the for loop so revert to color 15
  97. instead of color 0, the background would be restored.  In general, though, it
  98. may not be this easy to replace the background, so we must rely on some other
  99. method for preserving it.
  100.  
  101.                                 Example 10-2.
  102.  
  103.           #include <fastgraf.h>
  104.           #include <stdio.h>
  105.           #include <stdlib.h>
  106.           void main(void);
  107.  
  108.           void main()
  109.           {
  110.              int new_mode, old_mode;
  111.              int x;
  112.  
  113.              /* initialize the video environment */
  114.  
  115.              new_mode = fg_bestmode(320,200,1);
  116.              if (new_mode < 0 || new_mode == 12) {
  117.                 printf("This program requires a 320 ");
  118.                 printf("x 200 color graphics mode.\n");
  119.                 exit(1);
  120.                 }
  121.              old_mode = fg_getmode();
  122.              fg_setmode(new_mode);
  123.  
  124. 190  Fastgraph User's Guide
  125.  
  126.              /* draw some type of background */
  127.  
  128.              fg_setcolor(15);
  129.              fg_rect(0,319,0,199);
  130.  
  131.              /* move the object across the screen */
  132.  
  133.              for (x = -20; x < 320; x+=5) {
  134.                 fg_setcolor(10);
  135.                 fg_clprect(x,x+19,95,104);
  136.                 fg_waitfor(1);
  137.                 fg_setcolor(0);
  138.                 fg_clprect(x,x+19,95,104);
  139.                 }
  140.  
  141.              /* restore the original video mode and return to DOS */
  142.  
  143.              fg_setmode(old_mode);
  144.              fg_reset();
  145.           }
  146.  
  147.      To summarize, we see that simple animation is easy to implement, but it
  148. is destructive and typically causes the animated object to flicker.  For
  149. these reasons, it is not used too frequently.
  150.  
  151.  
  152. XOR Animation
  153.  
  154.      "Exclusive or" animation, or XOR animation for short, is an interesting
  155. extension of simple animation and is most useful when animating a single-
  156. color object against a single-color background.  Like simple animation, it
  157. uses the "erase and redisplay" technique to move an object, but it does this
  158. differently.  Instead of erasing the object by displaying it in the
  159. background color, XOR animation does so by displaying it in the same color
  160. using an exclusive or, or XOR, operation.  This method relies on a specific
  161. property of the exclusive or operator:
  162.  
  163.                (object XOR background) XOR object = background
  164.  
  165. In other words, if you XOR something twice in the same position, the result
  166. is the same as the original image in that position.
  167.  
  168.      Example 10-3 demonstrates XOR animation.  This program is similar to
  169. example 10-2, but it only runs in the 320 by 200 EGA graphics mode (mode 13).
  170. After establishing the video mode, it uses the Fastgraph routine fg_setfunc
  171. to select XOR mode.  This causes any subsequent graphics output to be XORed
  172. with the contents of video memory instead of just replacing it.  The
  173. fg_setfunc routine is described further in Chapter 15.
  174.  
  175.      The other differences between examples 10-3 and 10-2 are that the call
  176. to fg_setcolor has been moved outside the for loop, and that fg_setcolor
  177. takes a different value.  Since the existing background is bright white
  178. (color 15), we can't just use color 10 if we want to display a bright green
  179. object.  The desired value is that which when XORed with color 15 produces
  180. color 10; the easiest way to obtain this value is to XOR these two numbers.
  181. The call to fg_setcolor can be moved outside the loop because we display the
  182. object using the same color index throughout.
  183.                                         Chapter 10:  Animation Techniques  191
  184.  
  185.                                 Example 10-3.
  186.  
  187.           #include <fastgraf.h>
  188.           #include <stdio.h>
  189.           #include <stdlib.h>
  190.           void main(void);
  191.  
  192.           void main()
  193.           {
  194.              int old_mode;
  195.              int x;
  196.  
  197.              /* initialize the video environment */
  198.  
  199.              if (fg_testmode(13,1) == 0) {
  200.                 printf("This program requires EGA.\n");
  201.                 exit(1);
  202.                 }
  203.              old_mode = fg_getmode();
  204.              fg_setmode(13);
  205.              fg_setfunc(3);
  206.  
  207.              /* draw some type of background */
  208.  
  209.              fg_setcolor(15);
  210.              fg_rect(0,319,0,199);
  211.  
  212.              /* move the object across the screen */
  213.  
  214.              fg_setcolor(10^15);
  215.              for (x = -20; x < 320; x+=5) {
  216.                 fg_clprect(x,x+19,95,104);
  217.                 fg_waitfor(1);
  218.                 fg_clprect(x,x+19,95,104);
  219.                 }
  220.  
  221.              /* restore the original video mode and return to DOS */
  222.  
  223.              fg_setmode(old_mode);
  224.              fg_reset();
  225.           }
  226.  
  227.  
  228.      Fastgraph only supports the XOR pixel operation in the native EGA and
  229. VGA graphics video modes (modes 13 through 18).  Thus, you cannot use XOR
  230. animation in CGA, Tandy/PCjr, Hercules, or MCGA graphics modes.
  231.  
  232.      While XOR animation is non-destructive (that is, it restores the
  233. original background), it still suffers from the flickering encountered in
  234. simple animation.  In spite of this, it may be useful when animating a
  235. single-color object against a single-color background.
  236. 192  Fastgraph User's Guide
  237.  
  238.  
  239. Static Frame Animation
  240.  
  241.      Static frame animation uses a different strategy than simple animation
  242. or XOR animation.  The general scheme of this method is to create the entire
  243. animation sequence off-screen and then successively display each item, or
  244. frame, in this sequence on one position of the visual video page.  This
  245. results in a visually appealing animation that is non-destructive and does
  246. not include the flickering associated with simple animation and XOR
  247. animation.  Static frame animation requires the visual video page and one or
  248. more additional pages to implement.  The number of pages needed depends on
  249. the number of frames and the size of each frame.
  250.  
  251.      Example 10-4 runs in any 320 by 200 color graphics video mode and
  252. illustrates a simple use of static frame animation.  The program displays an
  253. animation sequence containing 12 frames; it displays this sequence three
  254. times.  The animation sequence consists of a bright green rectangle (magenta
  255. in CGA) moving from left to right across the center of the frame.  Each frame
  256. is 96 pixels wide and 50 pixels high.  The 12 frames are set up on an off-
  257. screen video page as shown below.
  258.  
  259.                          0       95 96     191 192    287
  260.  
  261.                       0
  262.                           frame 1    frame 2    frame 3
  263.                      49
  264.  
  265.                      50
  266.                           frame 4    frame 5    frame 6
  267.                      99
  268.  
  269.                     100
  270.                           frame 7    frame 8    frame 9
  271.                     149
  272.  
  273.                     150
  274.                           frame 10   frame 11   frame 12
  275.                     199
  276.  
  277.      Example 10-4 first establishes the video mode and allocates the
  278. additional video page (needed if using a video mode in which page 1 is a
  279. virtual video page).  The program then generates the background for frame 1;
  280. the background is a blue rectangle (cyan in CGA) with a white ellipse
  281. centered on it.  After the call to fg_ellipse, the first frame is ready.
  282.  
  283.      The next step is to create the remaining 11 frames.  In frame 2, the
  284. right half of the 20-pixel wide rectangle will enter the left edge of the
  285. frame.  In frame 3, the rectangle will be ten pixels farther right, or
  286. aligned against the left edge of the frame.  In frames 4 through 12, the
  287. rectangle will be ten pixels farther right in each frame, so by frame 12 only
  288. the left half of the rectangle appears on the right edge of the frame.  The
  289. first for loop in the program builds frames 2 through 12 by copying the
  290. background from frame 1 and then displaying the rectangle (that is, the
  291. animated object) in the proper position for that frame.
  292.  
  293.      The second for loop performs the animation sequence.  To display the 12-
  294. frame sequence three times, it must perform 36 iterations.  The loop simply
  295.                                         Chapter 10:  Animation Techniques  193
  296.  
  297. copies each frame from the proper position on video page 1 to the middle of
  298. the visual video page.  Note how the fg_waitfor routine is used to pause
  299. momentarily between each frame.
  300.  
  301.                                 Example 10-4.
  302.  
  303.        #include <fastgraf.h>
  304.        #include <stdio.h>
  305.        #include <stdlib.h>
  306.        void main(void);
  307.  
  308.        #define VISUAL 0
  309.        #define HIDDEN 1
  310.  
  311.        int xmin[] = {  0, 96,192,  0, 96,192,  0, 96,192,  0, 96,192};
  312.        int ymax[] = { 49, 49, 49, 99, 99, 99,149,149,149,199,199,199};
  313.  
  314.        void main()
  315.        {
  316.           int new_mode, old_mode;
  317.           int frame, offset;
  318.           int i, x, y;
  319.  
  320.           /* initialize the video environment */
  321.  
  322.           new_mode = fg_bestmode(320,200,2);
  323.           if (new_mode < 0 || new_mode == 12) {
  324.              printf("This program requires a 320 ");
  325.              printf("x 200 color graphics mode.\n");
  326.              exit(1);
  327.              }
  328.           old_mode = fg_getmode();
  329.           fg_setmode(new_mode);
  330.           fg_allocate(HIDDEN);
  331.  
  332.           /* draw the background in the upper left corner */
  333.  
  334.           fg_setpage(HIDDEN);
  335.           fg_setcolor(1);
  336.           fg_rect(0,95,0,49);
  337.           fg_setcolor(15);
  338.           fg_move(48,25);
  339.           fg_ellipse(20,20);
  340.  
  341.           /* display the animated object against each background */
  342.  
  343.           fg_setcolor(10);
  344.           offset = -10;
  345.           for (i = 1; i < 12; i++) {
  346.              x = xmin[i];
  347.              y = ymax[i];
  348.              fg_transfer(0,95,0,49,x,y,HIDDEN,HIDDEN);
  349.              fg_setclip(x,x+95,0,199);
  350.              fg_clprect(x+offset,x+offset+19,y-29,y-20);
  351.              offset += 10;
  352.              }
  353.  
  354. 194  Fastgraph User's Guide
  355.  
  356.           /* slide the object across the background three times */
  357.  
  358.           for (i = 0; i < 36; i++) {
  359.              frame = i % 12;
  360.              x = xmin[frame];
  361.              y = ymax[frame];
  362.              fg_transfer(x,x+95,y-49,y,112,124,HIDDEN,VISUAL);
  363.              fg_waitfor(2);
  364.              }
  365.  
  366.           /* restore the original video mode and return to DOS */
  367.  
  368.           fg_freepage(HIDDEN);
  369.           fg_setmode(old_mode);
  370.           fg_reset();
  371.        }
  372.  
  373. Dynamic Frame Animation
  374.  
  375.      Dynamic frame animation is similar to static frame animation, but all
  376. the animation frames are built as needed during the animation sequence
  377. instead of in advance.  When using this method, you must first store a copy
  378. of the background on an off-screen video page.  Then, to build a frame,
  379. create another copy (called the workspace) of the background elsewhere on the
  380. off-screen page (or even to a different off-screen page) and display the
  381. object on that copy.  Finally, transfer the workspace to the visual page.
  382. Like static frame animation, this method produces a non-destructive, flicker-
  383. free animation sequence.
  384.  
  385.      Example 10-5 is functionally identical to example 10-4, but it uses
  386. dynamic rather than static frame animation.  As before, the program builds
  387. the background in the upper left corner of video page 1, but it then uses
  388. fg_transfer to copy it to the center of the visual video page.  The for loop
  389. builds each frame as it is needed and also copies it to the center of the
  390. visual page.  Again, fg_waitfor creates the necessary pause between frames.
  391.  
  392.                                 Example 10-5.
  393.  
  394.          #include <fastgraf.h>
  395.          #include <stdio.h>
  396.          #include <stdlib.h>
  397.          void main(void);
  398.  
  399.          #define VISUAL 0
  400.          #define HIDDEN 1
  401.  
  402.          void main()
  403.          {
  404.             int new_mode, old_mode;
  405.             int frame, offset;
  406.             int i;
  407.  
  408.             /* initialize the video environment */
  409.  
  410.             new_mode = fg_bestmode(320,200,2);
  411.             if (new_mode < 0 || new_mode == 12) {
  412.  
  413.                                         Chapter 10:  Animation Techniques  195
  414.  
  415.                printf("This program requires a 320 ");
  416.                printf("x 200 color graphics mode.\n");
  417.                exit(1);
  418.                }
  419.             old_mode = fg_getmode();
  420.             fg_setmode(new_mode);
  421.             fg_allocate(HIDDEN);
  422.  
  423.             /* draw the background in the upper left corner */
  424.  
  425.             fg_setpage(HIDDEN);
  426.             fg_setcolor(1);
  427.             fg_rect(0,95,0,49);
  428.             fg_setcolor(15);
  429.             fg_move(48,25);
  430.             fg_ellipse(20,20);
  431.  
  432.             /* copy it to the center of the visual page */
  433.  
  434.             fg_transfer(0,95,0,49,112,124,HIDDEN,VISUAL);
  435.  
  436.             /* slide the object across the background three times */
  437.  
  438.             fg_setcolor(10);
  439.             for (i = 0; i < 36; i++) {
  440.                frame  = i % 12;
  441.                offset = 10 * frame - 10;
  442.                fg_transfer(0,95,20,29,112,105,HIDDEN,HIDDEN);
  443.                fg_rect(112+offset,131+offset,96,105);
  444.                fg_transfer(112,207,96,105,112,105,HIDDEN,VISUAL);
  445.                fg_waitfor(2);
  446.                }
  447.  
  448.             /* restore the original video mode and return to DOS */
  449.  
  450.             fg_freepage(HIDDEN);
  451.             fg_setmode(old_mode);
  452.             fg_reset();
  453.          }
  454.  
  455.  
  456.      Two items in example 10-5 merit further discussion.  First, we have
  457. chosen our workspace on page 1 so it uses the same screen space coordinates
  458. as the image area on the visual page.  This is not necessary unless you are
  459. using the fg_restore routine instead of fg_transfer.  Second, the program can
  460. use the faster fg_rect routine in place of fg_clprect.  It can do this
  461. because even though the object will extend beyond the workspace limits, we
  462. only transfer the workspace itself.  However, for this to function properly,
  463. the workspace's horizontal limits must fall on byte boundaries.
  464.  
  465.      Note too that we do not need to transfer the entire frame during the
  466. animation sequence.  In example 10-5, we know the vertical extremes of the
  467. moving image are y=96 and y=105, so we only transfer 10 rows instead of the
  468. entire frame.  We could similarly compute the x extremes for each frame and
  469. only transfer the necessary portion.  Recall, however, that fg_transfer
  470. extends the horizontal coordinates to byte boundaries, so we may copy a few
  471. extra pixels as well.  This may or may not affect the animation sequence.
  472. 196  Fastgraph User's Guide
  473.  
  474. Again, the problem is eliminated if you align your workspace on byte
  475. boundaries.
  476.  
  477.      When we use dynamic frame animation, it is easy to change the number of
  478. frames in the animation sequence.  Suppose we wish to produce a smoother
  479. animation by increasing the number of frames from 12 to 24.  This means the
  480. object will move in increments of five pixels instead of ten.  The only
  481. changes needed are to double the number of loop iterations, modify the
  482. calculations for the frame number and offset values as shown below, and
  483. reduce the fg_waitfor pause from 2 to 1.
  484.  
  485.                            frame  = i % 24;
  486.                            offset = 5 * frame - 10;
  487.  
  488. Compare this to all the changes that would be necessary if we were using
  489. static frame animation.
  490.  
  491.  
  492. Page Flipping
  493.  
  494.      Page flipping is a variation of frame animation in which you construct
  495. images on off-screen video pages and then repetitively make those pages the
  496. visual page.  We can further divide the page flipping technique into static
  497. and dynamic variants, as we did with frame animation.
  498.  
  499.      In static page flipping, we construct the entire animation sequence in
  500. advance, with one frame per video page.  Once this is done, we can display
  501. each frame by using the fg_setvpage routine to switch instantly from one
  502. video page to another.  Although this produces a smooth, flicker-free
  503. animation, we cannot carry the sequence very far before running out of video
  504. pages (and hence animation frames).
  505.  
  506.      In dynamic page flipping, we construct each animation frame when it is
  507. needed.  As in static page flipping, we construct each frame on a separate
  508. video page.  However, as example 10-6 demonstrates, we only need three video
  509. pages to produce the animation sequence, regardless of the number of frames
  510. in the sequence.  Two of the three video pages will alternate as the visual
  511. page, while the remaining video page keeps a copy of the background.
  512.  
  513.      Example 10-6, which performs an animation sequence similar to examples
  514. 10-4 and 10-5, illustrates dynamic frame animation in the 320 by 200 EGA
  515. graphics video mode (mode 13).  The program begins by displaying the
  516. background on video page 2.  Video pages 0 and 1 will alternate as the visual
  517. page; the page that is not the visual page is called the hidden page.  We
  518. start with page 0 as the visual page, and hence page 1 as the hidden page.
  519. To build each frame, the program uses fg_transfer to copy the background from
  520. page 2 to the hidden page and then uses fg_clprect to display the animated
  521. object at the correct position on the hidden page.  After this, it displays
  522. the next frame by using fg_setvpage to make the hidden page the visual page.
  523. Before beginning the next iteration, the program toggles the hidden page
  524. number in preparation for the next frame.
  525.  
  526.                                 Example 10-6.
  527.  
  528.           #include <fastgraf.h>
  529.           #include <stdio.h>
  530.  
  531.                                         Chapter 10:  Animation Techniques  197
  532.  
  533.           #include <stdlib.h>
  534.           void main(void);
  535.  
  536.           void main()
  537.           {
  538.              int old_mode;
  539.              int hidden;
  540.              int x;
  541.  
  542.              /* initialize the video environment */
  543.  
  544.              if (testmode(fg_13,3) == 0) {
  545.                 printf("This program requires EGA.\n");
  546.                 exit(1);
  547.                 }
  548.              old_mode = fg_getmode();
  549.              fg_setmode(13);
  550.  
  551.              /* draw the background on page two */
  552.  
  553.              fg_setpage(2);
  554.              fg_setcolor(1);
  555.              fg_rect(0,319,0,199);
  556.              fg_setcolor(15);
  557.              fg_move(160,100);
  558.              fg_ellipse(20,20);
  559.  
  560.              /* slide the object across the screen */
  561.  
  562.              hidden = 1;
  563.              setcolor(10);
  564.              for (x = -10; x < 320; x+=4) {
  565.                 fg_setpage(hidden);
  566.                 fg_transfer(0,319,0,199,0,199,2,hidden);
  567.                 fg_clprect(x,x+19,96,105);
  568.                 fg_setvpage(hidden);
  569.                 hidden = 1 - hidden;
  570.                 fg_waitfor(1);
  571.                 }
  572.  
  573.              /* restore the original video mode and return to DOS */
  574.  
  575.              fg_setmode(old_mode);
  576.              fg_reset();
  577.           }
  578.  
  579.  
  580.      A problem with either page flipping technique arises if we use virtual
  581. video pages.  Page flipping relies on the fact that changing the visual page
  582. number occurs instantly, which is exactly what happens when we use physical
  583. video pages.  However, such is not the case with virtual or logical pages
  584. because Fastgraph must copy the entire page contents into video memory.
  585. While this occurs quite rapidly, it is not instantaneous, and its effects are
  586. immediately apparent on the animation.
  587. 198  Fastgraph User's Guide
  588.  
  589.  
  590. Summary of Animation Techniques
  591.  
  592.      This chapter has presented five animation techniques:  simple animation,
  593. XOR animation, static frame animation, dynamic frame animation, and page
  594. flipping.  The following table summarizes their behavior.
  595.  
  596.                   technique      destructive?  flicker-free?
  597.  
  598.                   simple         yes           no
  599.                   XOR            no            no
  600.                   static frame   no            yes
  601.                   dynamic frame  no            yes
  602.                   page flipping  no            yes
  603.  
  604. Simple animation and XOR animation are elementary techniques that are seldom
  605. used once you master frame animation and page flipping.
  606.  
  607.      As stated at the beginning of this chapter, the simple examples
  608. presented here serve as the basis for understanding the mechanics of the
  609. animation techniques we have discussed.  In "real world" programs, you'll
  610. typically want to display an image using the fg_drwimage or fg_drawmap
  611. routines instead using rudimentary images such as the rectangles in our
  612. examples.  A helpful rule is to use pixel run maps (displayed by fg_dispfile,
  613. fg_display, or fg_displayp) for both backgrounds and moving objects, and then
  614. use fg_getimage or fg_getmap to retrieve the moving objects as bit-mapped
  615. images for later display.  Of course, it is desirable to do this "behind the
  616. scenes" work on video pages other than the visual page.
  617.