3 namespace PsychlopsSilverlight4test
\r
5 public class PsychlopsMain
\r
7 public void psychlops_main()
\r
9 var elem = Psychlops.Widgets.Browser.Element.byID("TheInput");
\r
11 Canvas window = new Canvas(500,500);
\r
13 var figure = new Rectangle();
\r
14 figure.set( 100, 100 );
\r
15 figure.fill = new Color(1.0, 0.0, 0.0);
\r
17 while (!Keyboard.esc.pushed())
\r
19 window.clear(Color.black);
\r
20 figure.centering().shift(elem.getValueAsDouble(), 1).draw();
\r
37 public class RandomDots
\r
40 public Point[] cood;
\r
43 cood = new Point[250];
\r
44 dot = new Rectangle(5, 5);
\r
48 dot.fill = Color.white;
\r
49 foreach (Point p in cood)
\r
51 dot.centering(p).draw();
\r
59 namespace PsychlopsSilverlight4test
\r
62 public class PsychlopsMain
\r
74 public void psychlops_main()
\r
76 cnvs = new Canvas(500, 500);
\r
77 img = new Image(isize * 2, isize * 2);
\r
78 fixation = new Rectangle(10, 10);
\r
79 fixation.fill = Color.red;
\r
80 //var poly = new Rectangle(100, 100);
\r
81 var poly = new Letters("日本語");
\r
82 //var poly = new Polygon(); poly.append(0, 100); poly.append(-100, 0); poly.append(0, -100); poly.append(100, 0);
\r
83 //var poly = new Ellipse(100, 100);
\r
84 //var poly = new Line(0,0,100, 0);
\r
85 poly.fill = Color.red;
\r
86 poly.stroke = new Stroke { color = Color.yellow, thick = 1 };
\r
89 var rng = new Interval();
\r
90 var slider = new Psychlops.Widgets.Slider("tesrt", 0 <= rng <= 5);
\r
92 dots = new RandomDots();
\r
98 cnvs.clear(new Color(Mouse.left.pressed() ? 0.75 : 0.5));
\r
99 col.set(Math.random(1.0));
\r
101 fixation.centering();
\r
102 fixation.draw(Color.red);
\r
104 //Figures.drawGabor(ref img, 20, 100, 1, 0, frames * 2.0 * Math.PI / tfreq / 60);
\r
105 //Figures.drawGaussian(ref img, 20, 1);
\r
106 Figures.drawGrating(ref img, 30, 30, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60);
\r
107 img.centering(Mouse.position);
\r
110 shape.centering(Mouse.position).shift(100,0);
\r
112 if (Keyboard.spc.pressed()) cnvs.var(Mouse.x, 100, 100);
\r
114 cnvs.var(frames, 20, 20);
\r
115 slider.value = frames/100.0;
\r
117 fixation.shift(100,100);
\r
118 fixation.draw(new Stroke(Color.blue, 3));
\r
120 for (int i=0; i<dots.cood.Length; i++)
\r
122 dots.cood[i].set(Math.random(500), Math.random(500));
\r