<HTML>
<HEAD>
<TITLE>DirectAnimation SDK, JScript sample</TITLE>
<SCRIPT LANGUAGE="JScript">
<!--
if (window.top.frames.length!=0 && window.top.frames[0].ShowNoButtons!=null)
    window.top.frames[0].ShowNoButtons();
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=black>
<CENTER>
<FONT FACE=VERDANA SIZE=5 COLOR=RED><STRONG>Graphics Primitives</STRONG></FONT>

<BR>
<OBJECT ID="DAViewer"
        STYLE="position:relative;width:800;height:600;ZINDEX:-1"
        CLASSID="CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D">
</OBJECT>
</CENTER>

<SCRIPT LANGUAGE="JScript">
<!--
  s = DAViewer.PixelLibrary;
  ds = s.NewDrawingSurface();

  ds.AutoSizeFillScale();
  ds.BorderColor(s.White);
  ds.LineColor(s.White);
  ds.FillColor(s.Red);
  ds.SecondaryFillColor(s.Blue);
  ds.Font("Arial", 22, true, false, false, false);

  polyPts = new Array(-15,5, -5,15, 5,15, 15,5, 15,-5, 5,-15, -5,-15, -15,-5);
  var top = -240;    
  var left = -200;  
  var vinc = 60;   
  var hinc = 140;   

  fs = s.Font("Verdana", 16, s.Teal);
  strs = new Array("Polygon","Rect","RoundRect","Text","Oval","Pie","Arc");
  for(i=0; i<strs.length; i++) 
    ds.OverlayImage( s.StringImage(strs[i],fs).Transform(s.Translate2(left-100, top+20+i*vinc)));

  fills = new Array(0,1,6,11);
  for(i=0; i<4; i++) {
    ds.FillStyle(fills[i]);
    ds.SaveGraphicsState();
      ds.Transform( s.Translate2(20+left+i*hinc, top) );
      ds.Polygon(polyPts);
    ds.RestoreGraphicsState();
    ds.Rect(left+i*hinc, top+vinc, 50, 20);
    ds.RoundRect(left+i*hinc, top+2*vinc, 50, 20, 20, 20);
    ds.Text("TEXT", left+i*hinc-6, top+3.3*vinc);
    ds.Oval(left+i*hinc, top+4*vinc, 50, 50);
    ds.PieDegrees(left+i*hinc, top+5*vinc, 0, -120, 50, 50);
    ds.ArcDegrees(left+i*hinc, top+6*vinc, 0, -120, 50, 50);
  }

  DAViewer.Image = ds.Image;
  DAViewer.Start();
-->
</SCRIPT>
</BODY>
</HTML>
