Пример #1
0
        void quickGalleryView_GetThumbnailImage(object sender, DevExpress.Utils.ThumbnailImageEventArgs e)
        {
            int    rowHandle = this.quickGalleryView.GetRowHandle(e.DataSourceIndex);
            DmFile model     = (DmFile)this.quickGalleryView.GetRow(rowHandle);

            ThumbHelper.GetThumbnailImage(sender, e, model);
        }
Пример #2
0
        private void galleryView_GetThumbnailImage(object sender, ThumbnailImageEventArgs e)
        {
            int    rowHandle = this.galleryView.GetRowHandle(e.DataSourceIndex);
            DmFile file      = (DmFile)this.galleryView.GetRow(rowHandle);

            ThumbHelper.GetThumbnailImage(sender, e, file);
        }
Пример #3
0
 protected void ASPxFileManager1_CustomThumbnail(object source, DevExpress.Web.ASPxFileManager.FileManagerThumbnailCreateEventArgs e)
 {
     if (ThumbHelper.CanCreateThumbnail(e.File.Extension))
     {
         string imageKey = ThumbHelper.GetHash(e.File.RelativeName);
         e.ThumbnailImage.Url = "Thumb.ashx?key=" + imageKey;
     }
 }
Пример #4
0
        public static void PatchItemsFile(WebGalleryBase gallery, List <DmFile> files)
        {
            string htmlFile = Path.Combine(gallery.TargetFolder, gallery.ItemsFile);

            if (!File.Exists(htmlFile))
            {
                throw new InvalidOperationException();
            }
            if (files == null || files.Count < 1)
            {
                return;
            }

            string        html      = File.ReadAllText(htmlFile);
            int           insertInd = html.IndexOf(WebGalleryBase.inputPoint);
            StringBuilder sb        = new StringBuilder(html);

            sb.Remove(insertInd, WebGalleryBase.inputPoint.Length);

            foreach (DmFile file in files)
            {
                //TO DO
                string pathFull     = gallery.ImagesFolderFullPath + file.FileName;
                string pathRelative = Path.Combine(gallery.ImagesFolder, file.FileName);
                ThumbHelper.GetThumbnailImage(file).Save(pathFull, System.Drawing.Imaging.ImageFormat.Jpeg);

                //string pathFullThumb = gallery.ThumbsFolderFullPath + file.FileName;
                //string pathRelativeThumb = Path.Combine(gallery.ThumbsFolder, file.FileName);
                //ThumbHelper.GetIconImage(file).Save(pathFullThumb, System.Drawing.Imaging.ImageFormat.Jpeg);

                pathRelative = pathRelative.Replace(@"\", "/");
                //pathRelativeThumb = pathRelativeThumb.Replace(@"\", "/");
                string newString = gallery.GenerateItemTag(pathRelative, null);
                newString += Environment.NewLine;
                sb.Insert(insertInd, newString);
                insertInd += newString.Length;
            }
            File.WriteAllText(htmlFile, sb.ToString());
        }
Пример #5
0
        private void galleryControlGallery1_GetThumbnailImage(object sender, DevExpress.XtraBars.Ribbon.Gallery.GalleryThumbnailImageEventArgs e)
        {
            DmFile file = (DmFile)e.Item.Tag;

            ThumbHelper.GetThumbnailImage(sender, e, file);
        }