Beispiel #1
0
 public void Load(string fileName, bool isCover)
 {
     try
     {
         this.ScanImage = new ScanImage(fileName, isCover);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
        public ColorDialog(ScanImage image)
        {
            InitializeComponent();

            this.ScanImageSource = image.GetThumbnail((int)this.Height);

            if (!Settings.Default.AdvancedColorCorection)
            {
                this.GammaGroupBox.Visibility = System.Windows.Visibility.Collapsed;
                this.SaturationGroupBox.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
Beispiel #3
0
 public void Clear()
 {
     try
     {
         this.ScanImage = null;
         //this.Source = ImageFunctions.Convert(Properties.Resources.BlankImage);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #4
0
 public ColorDialog(Window parent, ScanImage image)
     : this(image)
 {
     this.Owner = parent;
 }
Beispiel #5
0
 //public void LoadOriginal()
 //{
 //    _source = null;
 //    this.Source = ImageFunctions.Load(this.FullName);
 //}
 //public void Rotate180()
 //{
 //     this.Source = ImageFunctions.Rotate180(this.Source);
 //}
 //public void RotateLeft()
 //{
 //    this.Source = ImageFunctions.RotateLeft(this.Source);
 //}
 //public void RotateRight()
 //{
 //    this.Source = ImageFunctions.RotateRight(this.Source);
 //}
 //public void FlipHorizontal()
 //{
 //    this.Source = ImageFunctions.FlipHorizontal(this.Source);
 //}
 //public void FlipVertical()
 //{
 //    this.Source = ImageFunctions.FlipVertical(this.Source);
 //}
 //public void Deskew(bool fast = true)
 //{
 //    if (fast)
 //    {
 //        float skewAngle = ImageFunctions.GetDeskewAngle(this.Thumbnail);
 //        this.Source = ImageFunctions.Deskew(this.Source, -skewAngle);
 //    }
 //    else
 //    {
 //        this.Source = ImageFunctions.Deskew(this.Source);
 //    }
 //}
 //public void Crop(Rect cropZone)
 //{
 //    this.Source = ImageFunctions.Crop(this.Source, cropZone);
 //}
 //public void AdjustColor(int brightness, double contrast, double gamma)
 //{
 //    this.Source = ImageFunctions.AdjustColor(this.Source, brightness, contrast, gamma);
 //}
 //public void Save()
 //{
 //    if (this.IsExternalUrl) return;
 //    if (this.IsCover)
 //    {
 //        ImageFunctions.SaveJpeg(_source, _fullName);
 //    }
 //    else
 //    {
 //        TiffCompressOption compression = (BlackAndWhite ? TiffCompressOption.Ccitt4 : TiffCompressOption.Lzw);
 //        ImageFunctions.SaveTiff(_source, _fullName, _dpi.Value, compression);
 //    }
 //    _source = null;
 //}
 public bool Equals(ScanImage obj)
 {
     return (obj != null && obj.FullName.Equals(this.FullName));
 }
Beispiel #6
0
        private void DownloadObalkyKnihCZ()
        {
            try
            {
                if (Settings.Default.CheckObalkyKnihCZ && !ScannedImages.HasCover)
                {
                    string coverUrl = DozpController.SearchCoverUrl(SelectedCatalogue.ZServerUrl, CurrentBook);

                    if (!String.IsNullOrEmpty(coverUrl))
                    {
                        ScanImage cover = new ScanImage(coverUrl, true);
                        cover.BlackAndWhite = false;
                        ScannedImages.Add(cover);
                        App.DoEvents();
                    }
                }
            }
            catch (Exception ex)
            {
                //string message = "Nepodařilo se načíst obálku ze serveru ObalkyKnih.cz."
                MessageBox.Show(ex.Message, "ObalkyKnih.cz", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                Logger.Log(String.Format("WARNING: {0}", ex.Message));
            }
        }