Пример #1
0
        public static byte[] GetPageImageBytes(Guid id, int page)
        {
            try
            {
                ComicBook comic = GetComics().First(x => x.Id == id);
                // Webcomics are not (yet) supported. If I don't filter them here, ComicRack hangs.
                if (comic.IsDynamicSource)
                {
                    return(null);
                }

                var index    = comic.TranslatePageToImageIndex(page);
                var provider = GetProvider(comic);
                if (provider == null)
                {
                    return(null);
                }

                return(provider.GetByteImage(index)); // ComicRack returns the page converted to a jpeg image.....
            }
            catch                                     //(Exception e)
            {
                //MessageBox.Show(e.ToString());
                return(null);
            }
        }
Пример #2
0
 private static Bitmap GetPageBitmap(Guid id, int page)
 {
     try
     {
         ComicBook comic    = GetComics().First(x => x.Id == id);
         var       index    = comic.TranslatePageToImageIndex(page);
         var       provider = GetProvider(comic);
         if (provider == null)
         {
             return(null);
         }
         return(provider.GetImage(index)); // ComicRack returns the page converted to a jpeg image.....
     }
     catch                                 //(Exception e)
     {
         //MessageBox.Show(e.ToString());
         return(null);
     }
 }