当前位置: 首页>>代码示例>>C#>>正文


C# Slide.Export方法代码示例

本文整理汇总了C#中Slide.Export方法的典型用法代码示例。如果您正苦于以下问题:C# Slide.Export方法的具体用法?C# Slide.Export怎么用?C# Slide.Export使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Slide的用法示例。


在下文中一共展示了Slide.Export方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsSameLooking

        public static void IsSameLooking(Slide expSlide, Slide actualSlide)
        {
            var hashCode = DateTime.Now.GetHashCode();
            actualSlide.Export(PathUtil.GetTempPath("actualSlide" + hashCode), "PNG");
            expSlide.Export(PathUtil.GetTempPath("expSlide" + hashCode), "PNG");

            IsSameLooking("expSlide" + hashCode, "actualSlide" + hashCode);
        }
开发者ID:oswellchan,项目名称:PowerPointLabs,代码行数:8,代码来源:SlideUtil.cs

示例2: SlideData

        private SlideData(Slide slide)
        {
            var hashCode = DateTime.Now.GetHashCode();
            SlideImage = "slide" + hashCode;
            slide.Export(Path.GetTempPath() + SlideImage, "PNG");

            Animation = new List<IEffectData>();
            var seq = slide.TimeLine.MainSequence;
            for (int i = 1; i <= seq.Count; ++i)
            {
                var effect = seq[i];
                Animation.Add(EffectData.FromEffect(effect));
            }
        }
开发者ID:oswellchan,项目名称:PowerPointLabs,代码行数:14,代码来源:SlideData.cs

示例3: GetSlideImage

        private static Image GetSlideImage(Slide s, MemoryStream ms)
        {
            // Export the slide to a temporary file
            string filename = tfc.BasePath + "\\" + Guid.NewGuid().ToString() + ".emf";
            tfc.AddFile(filename, false);
            s.Export(filename, "EMF", 0, 0);

            // Create a Metafile from that file and serialize it for transport
            // Pri2: Shouldn't this just be the EMF stream bytes, more cross platform?
            Image image = Image.FromFile(filename);

            // Check for size overage and downconvert to JPG if EMF is too large
            // Note: By default EMF is the best, but we switch to JPG after a larger size

            // TODO: The max EMF size should be read from the UI or config file
            if (ImageSize(image, ms) > 250000)
            {
                image.Dispose();

                filename = tfc.BasePath + "\\" + Guid.NewGuid().ToString() + ".jpeg";
                tfc.AddFile(filename, false);
                // TODO: The width/height should be read from the UI or config file
                s.Export(filename, "JPG", 1200, 900);
                image = Image.FromFile(filename);

                // TODO: EMF is better quality than JPG, so we have to ensure that we are not
                // creating a bigger file with less quality
            }

            return image;
        }
开发者ID:abhishek-kumar,项目名称:AIGA,代码行数:31,代码来源:OfficeDoc2RTDoc.cs

示例4: GenerateThumbnail

        private void GenerateThumbnail(Slide slide)
        {
            var Width = Convert.ToInt32(ThisAddIn.instance.Application.ActivePresentation.SlideMaster.Width);
            var Height = Convert.ToInt32(ThisAddIn.instance.Application.ActivePresentation.SlideMaster.Height);
            var filename = System.IO.Directory.GetCurrentDirectory().ToString() + "\\pptSlideThumbnail" + slide.SlideNumber + ".png";
            try
            {
                slide.Export(filename, "PNG", Width, Height);
            }
            catch (Exception ex)
            {
            }
            BitmapImage img = new BitmapImage();
            MemoryStream ms = new MemoryStream(File.ReadAllBytes(filename));
            PngBitmapDecoder bd = new PngBitmapDecoder(ms, BitmapCreateOptions.IgnoreImageCache, BitmapCacheOption.None);

            ImageSource image = bd.Frames[0];
            if (slideThumbs.Any(c => c.slideNumber == slide.SlideNumber))
                slideThumbs.Remove(slideThumbs.Where(c => c.slideNumber == slide.SlideNumber).First());
            slideThumbs.Add(new SlideThumbnail { thumbnail = image, slideNumber = slide.SlideNumber });
        }
开发者ID:StackableRegiments,项目名称:metl2011,代码行数:21,代码来源:SimpleSlideShowWindow.xaml.cs

示例5: GetSlideByteArray

        /// <summary>
        /// Gets the image data of the entire given <code>Slide</code>.
        /// </summary>
        /// <param name="slide">The <code>Slide</code>.</param>
        /// <returns>The image data of the entire slide.</returns>
        private byte[] GetSlideByteArray(Slide slide)
        {
            // get a temp filename
            String filename = Path.GetTempFileName();

            // export the slide to this file location
            slide.Export(filename, Constants.EXPORT_FILETYPE, Constants.EXPORT_WIDTH, Constants.EXPORT_HEIGHT);

            // read all contents into the buffer
            byte[] buffer = File.ReadAllBytes(filename);
            // and remove the file afterwards, because that's nice
            File.Delete(filename);

            return buffer;
        }
开发者ID:sgade,项目名称:powerpoint-remote-server,代码行数:20,代码来源:PPRAddIn.cs

示例6: ExportSlide

 public static void ExportSlide(Slide slide, string exportPath)
 {
     slide.Export(exportPath,
                  "PNG",
                  (int) GetDesiredExportWidth(),
                  (int) GetDesiredExportHeight());
 }
开发者ID:youthinkk,项目名称:PowerPointLabs,代码行数:7,代码来源:Graphics.cs

示例7: Ppt2imgProc

 protected virtual int Ppt2imgProc(Slide slide, int idx, int file_c)
 {
     this.Total[idx] = 1;
     var spath = String.Format(this.AsDstF, file_c);
     var as_dir = Path.GetDirectoryName(spath);
     if (!Directory.Exists(as_dir))
     {
         Directory.CreateDirectory(as_dir);
     }
     if (this.ShowLog)
     {
         L.D("ppt2img parsing file({0},{1}) to {2}", this.AsSrc, file_c, spath);
     }
     slide.Export(spath, this.FilterName, 0, 0);
     var rspath = String.Format(this.DstF, this.Beg + file_c);
     this.Result.Count += 1;
     this.Result.Files.Add(rspath);
     this.Done[idx] = 1;
     this.OnDone();
     return 1;
 }
开发者ID:Centny,项目名称:cswf.doc,代码行数:21,代码来源:PowerPointCov.cs

示例8: GetSlideImage

        private static Image GetSlideImage(Slide s, MemoryStream ms)
        {
            // Export the slide to a temporary file
            string filename = tfc.BasePath + "\\" + Guid.NewGuid().ToString() + ".emf";
            tfc.AddFile(filename, false);
            s.Export(filename, "EMF", 0, 0);

            // Create a Metafile from that file and serialize it for transport
            // Pri2: Shouldn't this just be the EMF stream bytes, more cross platform?
            Image image = Image.FromFile(filename);

            // Check for size overage and downconvert to JPG if EMF is too large
            // Note: By default EMF is the best, but we switch to JPG after a larger size

            // TODO: The max EMF size should be read from the UI or config file
            if (ImageSize(image, ms) > 250000)
            {
                image.Dispose();

                //We can get reasonable reliability and quality by exporting wmf from PPT, then using
                //.Net to make jpg.  Exporting directly to jpg was found to be flaky with some
                //PPT versions, and to result in worse quality.
                string wmffilename = tfc.BasePath + "\\" + Guid.NewGuid().ToString() + ".wmf";
                string jpgfilename = tfc.BasePath + "\\" + Guid.NewGuid().ToString() + ".jpg";
                tfc.AddFile(wmffilename, false);
                tfc.AddFile(jpgfilename, false);
                s.Export(wmffilename, "WMF", 0, 0);
                //Convert to jpg
                Image img = Image.FromFile(wmffilename);
                img.Save(jpgfilename, ImageFormat.Jpeg);
                img.Dispose();
                image = Image.FromFile(jpgfilename);
            }

            return image;
        }
开发者ID:psyCHOder,项目名称:conferencexp,代码行数:36,代码来源:OfficeDoc2RTDoc.cs

示例9: UploadAsync

        public Task<dynamic> UploadAsync(Slide slide)
        {
            var tempFileString = Guid.NewGuid().ToString();

            var questionnaireImageFile = _tempPath + tempFileString + ".png";

            slide.Export(questionnaireImageFile, "png", 640, (int)(640 * slide.Master.Height / slide.Master.Width));

            return Task.Factory.StartNew(()=> UploadTempFile(questionnaireImageFile));
        }
开发者ID:ccnuyan,项目名称:PowerPointQuestionnaire,代码行数:10,代码来源:QuestionnaireUtil.cs

示例10: GetSlideMd5

        //deprecated
        public string GetSlideMd5(Slide slide)
        {
            var questionnaire = Deserialize(slide);
            var questionnaireImageFile = _tempPath + questionnaire.id + ".png";
            if (File.Exists(questionnaireImageFile))
            {
                File.Delete(questionnaireImageFile);
            }
            slide.Export(questionnaireImageFile, "png", 640, (int)(640 * slide.Master.Height / slide.Master.Width));

            return GetFileMd5Code(questionnaireImageFile);
        }
开发者ID:ccnuyan,项目名称:PowerPointQuestionnaire,代码行数:13,代码来源:QuestionnaireUtil.cs


注:本文中的Slide.Export方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。