Index: trunk/Ohana/src/opihi/cmd.astro/outline2.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/outline2.c	(revision 3693)
+++ trunk/Ohana/src/opihi/cmd.astro/outline2.c	(revision 5846)
@@ -303,19 +303,16 @@
 int plot_outline () {
   
-  char *buffer, *line;
-  int Nline, Nimage, Ximage;
+  int Nimage, Ximage;
   float xp, yp, x, y;
   float dx, dy, theta, t, dt;
+  int Noverlay, NOVERLAY;
+  KiiOverlay *overlay;
   
   Nimage = -1;
   if (!GetImage (&Ximage, &Nimage)) return (FALSE);
   
-  ALLOCATE (buffer, char, 65536);  /* space for 512 lines of 128 bytes */
-  bzero (buffer, 65536);
-  ALLOCATE (line, char, 1024);     /* space to read the file */
-  Nline = 0;
-  
-  SendGraphCommand (Ximage, 4, "LOAD");
-  SendGraphCommand (Ximage, 16, "OVER %9d ", 0);
+  Noverlay = 0;
+  NOVERLAY = 1000;
+  ALLOCATE (overlay, KiiOverlay, Noverlay);
   
   dx = par[2];
@@ -331,21 +328,15 @@
     y = xp * sin (theta * RAD_DEG) + yp * cos (theta * RAD_DEG) + par[1];
     
-    sprintf (&buffer[Nline*128], "%15s %20.10f %20.10f %20.10f %20.10f ", "BOX", x, y, 1.0, 1.0);
-    Nline ++;
-    
-    if (Nline >= 510) {
-      SendGraphCommand (Ximage, 16, "NLINES  %7d ", Nline);
-      write (Ximage, buffer, Nline*128);
-      bzero (buffer, 65536);
-      Nline = 0;
-    }
-  }
-  
-  SendGraphCommand (Ximage, 16, "NLINES  %7d ", Nline);
-  write (Ximage, buffer, Nline*128);
-  SendGraphCommand (Ximage, 16, "DONE");
-
-  free (buffer);
-  free (line);
+    overlay[Noverlay].type = KII_OVERLAY_BOX;
+    overlay[Noverlay].x = x;
+    overlay[Noverlay].y = y;
+    overlay[Noverlay].dx = 1.0;
+    overlay[Noverlay].dy = 1.0;
+
+    Noverlay ++;
+    CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
+  }
+  KiiLoadOverlay (Ximage, overlay, Noverlay, "red");
+  free (overlay);
   return (TRUE);
 }
