Esempio n. 1
0
        private void AddBTN_Click(object sender, EventArgs e)
        {
            if (tmp == null)
            {
                return;
            }
            int   w = Int32.Parse(widthInputTB.Text), h = Int32.Parse(heightInputTB.Text);
            float angle = float.Parse(angleInputTB.Text);
            var   insert = ScalingFilter.Process(tmp, w, h);
            int   x = Int32.Parse(xInputTB.Text), y = Int32.Parse(yInputTB.Text);

            if (angle > 1e-10)
            {
                insert = RotateFilter.Process(insert, angle);
            }
            if (insert.X != x || insert.Y != y)
            {
                insert.ChangeXY(x, y);
            }
            this.Scene.Photos.Insert(0, insert);
            this.Scene.UpdatePhotos();

            Draw();
            ListToComboBox(photoCB, this.Scene.Photos);
        }
Esempio n. 2
0
        public override void Run()
        {
            double[] myDataArr = new double[] { 0.0, 1.0, 2.0 };

            NumericFilterParam m = new NumericFilterParam("m");

            m.Value = 10.0;
//			lsf	= new LinearStaticFilter();
//			ldf	= new LinearDynamicFilter();
            sf  = new ScalingFilter(m);
            sf2 = new ScalingFilter(m);
//			sf	= new ScalingFilter();


//			Console.WriteLine("LinearStatusFilter Test:");
//			Console.WriteLine("  " + lsf.ToString() + ":");
//			foreach (double val in lsf.ProcessFilter(myDataArr))
//			{
//				Console.WriteLine("  " + val.ToString());
//			}
//			Console.WriteLine();
//
//
//			Console.WriteLine("LinearDynamicFilter Test:");
//			Console.WriteLine("  " + ldf.ToString() + ":");
//			foreach (double val in myDataArr)
//			{
//				Console.WriteLine("  " + ldf.ProcessFilter(val).ToString());
//			}
//			Console.WriteLine();
//
//			Console.WriteLine("ScalingFilter2 Test:");
//			m.Value = 10;
//			Console.WriteLine("  " + sf.ToString() + ":");
//			foreach (double val in sf.ProcessFilter(myDataArr))
//			{
//				Console.WriteLine("  " + val.ToString());
//			}
//			Console.WriteLine();


            for (m.Value = 0.0; m.Value < 25.0;)
            {
                Console.WriteLine("ScalingFilter1 Test:");
                Console.WriteLine("  " + sf.ToString() + ":");
                foreach (double val in sf.ProcessFilter(myDataArr))
                {
                    Console.WriteLine("  " + val.ToString());
                }
                Console.WriteLine();


                Console.WriteLine("ScalingFilter2 Test:");
                Console.WriteLine("  " + sf2.ToString() + ":");
                foreach (double val in sf2.ProcessFilter(myDataArr))
                {
                    Console.WriteLine("  " + val.ToString());
                }
                Console.WriteLine();

                m.Value += 10.0;
            }
        }