X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;ds=sidebyside;f=test3%2FPsychlopsMain.cs;h=bbaf192ef6a0cc31ed88a48a9cc1bcb3b8ac8d74;hb=e22f217b876609c575411512e127062c35d49441;hp=1991b9d62f3b7c1a17c7c0324154d5c904cb356e;hpb=5941ac86334f02204b7470b022f69f6cb382850d;p=psychlops%2Fsilverlight.git diff --git a/test3/PsychlopsMain.cs b/test3/PsychlopsMain.cs index 1991b9d..bbaf192 100644 --- a/test3/PsychlopsMain.cs +++ b/test3/PsychlopsMain.cs @@ -1,5 +1,30 @@ using Psychlops; +namespace Psychlops +{ + + public class RandomDots + { + Rectangle dot; + public Point[] cood; + public RandomDots() + { + cood = new Point[100]; + dot = new Rectangle(5, 5); + } + public void draw() + { + dot.fill = Color.white; + foreach (Point p in cood) + { + dot.centering(p).draw(); + } + } + } + +} + + namespace PsychlopsSilverlight3test { @@ -13,6 +38,7 @@ namespace PsychlopsSilverlight3test int isize = 100; double tfreq = 1; int frames; + RandomDots dots; public void psychlops_main() { @@ -20,8 +46,8 @@ namespace PsychlopsSilverlight3test img = new Image(isize * 2, isize * 2); fixation = new Rectangle(10, 10); fixation.fill = Color.red; - var poly = new Rectangle(100, 100); - //var poly = new Letters("日本語"); + //var poly = new Rectangle(100, 100); + var poly = new Letters("日本語"); //var poly = new Polygon(); poly.append(0, 100); poly.append(-100, 0); poly.append(0, -100); poly.append(100, 0); //var poly = new Ellipse(100, 100); //var poly = new Line(0,0,100, 0); @@ -29,6 +55,11 @@ namespace PsychlopsSilverlight3test poly.stroke = new Stroke { color = Color.yellow, thick = 1 }; shape = poly; + var rng = new Interval(); + var slider = new Psychlops.Widgets.Slider("tesrt", 0 <= rng <= 5); + + dots = new RandomDots(); + while(true) { frames++; @@ -41,7 +72,7 @@ namespace PsychlopsSilverlight3test //Figures.drawGabor(ref img, 20, 100, 1, 0, frames * 2.0 * Math.PI / tfreq / 60); //Figures.drawGaussian(ref img, 20, 1); - Figures.drawGrating(ref img, 100, 100, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60); + Figures.drawGrating(ref img, 30, 30, 20, 1, 2, frames * 2.0 * Math.PI / tfreq / 60); img.centering(Mouse.position); img.draw(); @@ -49,11 +80,17 @@ namespace PsychlopsSilverlight3test shape.draw(); if (Keyboard.spc.pressed()) cnvs.var(Mouse.x, 100, 100); - cnvs.var(frames, 10, 20); + cnvs.var(frames, 20, 20); + slider.value = frames/100.0; fixation.shift(100,100); fixation.draw(new Stroke(Color.blue, 3)); - AppState.statusBar = "dhdyr"; + + for (int i=0; i