Exemple #1
0
 private void CreateBuilder()
 {
     if (index == LBEffects.SelectedIndex) return;
     index = LBEffects.SelectedIndex;
     if (index == -1) return;
     builderobj = (IImageBuilder)dt.Rows[index][2];
     builderobj.SetSourceImage(Source);
     option = (ImageOption)dt.Rows[index][3];
     grid.SelectedObject = option;
 }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="processable"></param>
        /// <param name="sourcePath"></param>
        /// <param name="savePath"></param>
        /// <returns></returns>
        public static TryResult ProcessBitmap(IImageBuilder processable, string sourcePath, string savePath)
        {
            if (processable == null) return false;
            if (!File.Exists(sourcePath)) return false;

            try
            {
                processable.SetSourceImage(sourcePath);
                var image = processable.ProcessBitmap();
                image.Save(savePath);
            }
            catch (Exception ex)
            {
                return ex;
            }

            return true;
        }