using Psychlops; namespace PsychlopsSilverlight3test { public class PsychlopsMain { Canvas cnvs; Image img; Rectangle fixation; Shape shape; Color col; int isize = 100; double tfreq = 1; int frames; public System.Collections.Generic.IEnumerator psychlops_main() { cnvs = new Canvas(500, 500); img = new Image(isize * 2, isize * 2); fixation = new Rectangle(10, 10); var poly = new Letters("日本語"); shape = poly; cnvs.clear(Color.gray); while(true) { frames++; cnvs.clear(new Color(Mouse.left.pressed() ? 0.75 : 0.25)); col.set(Math.random(1.0)); fixation.centering(); fixation.draw(Color.red); Figures.drawGabor(ref img, 20, 100, 1, 0, frames * 2.0 * Math.PI / tfreq / 60); //Figures.drawGaussian(ref img, 20, 1); //Figures.drawGrating(10, 1, 2, cnvs.frame * 2.0 * Math.PI / tfreq / 60); img.centering(Mouse.position); img.draw(); shape.centering(Mouse.position); shape.draw(Color.red); if (Keyboard.spc.pressed()) cnvs.var(Mouse.x, 100, 100); cnvs.var(frames, 10, 20); yield return 3; } } } }