Beispiel #1
0
 private void btClose_Click(object sender, EventArgs e)
 {
     SetFromCheckBoxes();
     SetFromTextBoxes();
     MembersMorphoParameters.Serialization(mmp);
     if (MMPSaved != null)
     {
         MMPSaved(mmp);
     }
     this.Close();
 }
Beispiel #2
0
 public void Set(Bitmap _bmp, Bitmap _origin)
 {
     flag = true;
     mmp  = MembersMorphoParameters.Deserialization();
     //System.Threading.Thread.Sleep(1000);
     this.Enabled = true;
     SetTextBoxes();
     SetCheckBoxes();
     SetToolTip();
     bmp = _bmp.Clone(new Rectangle(0, 0, _bmp.Width, _bmp.Height), PixelFormat.Format24bppRgb);             //ImageProcessor.Image.Clone(_bmp);
     //bmp.Save(@"d:\qwerty.bmp");
     origin = _origin.Clone(new Rectangle(0, 0, _origin.Width, _origin.Height), PixelFormat.Format24bppRgb); //ImageProcessor.Image.Clone(_origin);
     //bmp.Save(@"d:\origin.bmp");
     flag = false;
     SetColor();
     //this.ShowDialog();
 }
Beispiel #3
0
        public static void Serialization(MembersMorphoParameters mmp)
        {
            mmp.filter        = false;
            mmp.countToReport = 0;
            for (int i = 0; i < 16; i++)
            {
                if (mmp.mp[i].filter && !mmp.filter)
                {
                    mmp.filter = true;
                }
                if (mmp.mp[i].ToReport)
                {
                    mmp.countToReport++;
                }
            }
            Stream          stream    = File.Open(Application.StartupPath + @"\mmp.dat", FileMode.Create);
            BinaryFormatter formatter = new BinaryFormatter();

            formatter.Serialize(stream, mmp);
            stream.Close();
        }
Beispiel #4
0
        public static MembersMorphoParameters Deserialization()
        {
            MembersMorphoParameters ret;
            Stream stream;

            try
            {
                stream = File.Open(Application.StartupPath + @"\mmp.dat", FileMode.Open);
            }
            catch
            {
                ret = new MembersMorphoParameters();
                return(ret);
            }
            BinaryFormatter formatter = new BinaryFormatter();

            try
            {
                ret = (MembersMorphoParameters)formatter.Deserialize(stream);
            }
            catch
            {
                ret = new MembersMorphoParameters();
                stream.Close();
            }
            stream.Close();
            //ret.filter = false;
            //for (int i = 0; i < 16; i++)
            //{
            //    if (ret.mp[i].filter)
            //    {
            //        ret.filter = true;
            //        break;
            //    }
            //}
            return(ret);
        }
Beispiel #5
0
 public FormMorphoFilter()
 {
     InitializeComponent();
     this.Enabled = false;
     mmp          = MembersMorphoParameters.Deserialization();
 }