using Psychlops; namespace PsychlopsSilverlight3test { public class PsychlopsMain { Canvas cnvs; Image img; Rectangle fixation; int isize = 100; double tfreq = 1; public void initialize() { cnvs = new Canvas(500, 500); img = new Image(isize * 2, isize * 2); fixation = new Rectangle(10, 10); cnvs.clear(Color.gray); } public void each_frames() { cnvs.clear(new Color(Mouse.left.pressed() ? 1.0 : 0.5)); img.field( (x, y) => new Color(.5 + Math.gaussian(Math.radius(x - isize, y - isize), isize / 8.0) * .5 * Math.sin(cnvs.frame * 2 * Math.PI / tfreq / 60 + x / 3.0)) ); img.centering(Mouse.position); //img.shift(1,0); img.draw(); fixation.centering(); fixation.draw(Color.red); cnvs.flip(); } } }