Exemplo n.º 1
0
        public SvrImgInTreard(Bitmap _bmp, string _pref, int _count)
        {
            conteiner        = new BackgroundWorkParams();
            conteiner.param1 = _bmp;
            conteiner.param2 = _pref;
            conteiner.param3 = _count;

            bw                     = new BackgroundWorker();
            bw.DoWork             += bw_dowork;
            bw.RunWorkerCompleted += bw_completed;
        }
Exemplo n.º 2
0
 private void bw_dowork(object sender, DoWorkEventArgs e)
 {
     try
     {
         BackgroundWorkParams param = (BackgroundWorkParams)e.Argument;
         string numb   = param.param3.ToString().PadLeft(4, '0');
         string fileNM = param.param2 + numb + ".jpg";
         if (!Directory.Exists(Path.GetDirectoryName(fileNM)))
         {
             Directory.CreateDirectory(Path.GetDirectoryName(fileNM));
         }
         Bitmap tmp = Flokal.Common.Methods.Image.Clone(param.param1);
         tmp.Save(fileNM);
     }
     catch (Exception ex)
     {
         string error = " SvrImgInTreard.Dowork(). Error in time save temp file - " + ex.Message;
         Flokal.Protocol.Logging.Error(error);
         // throw new Exception(error); - no sens
     }
 }