Пример #1
0
        public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source,
            Shape imageShape)
        {
            designer.ApplyPseudoTextWhenNoTextShapes();

            if ((option.IsUseBannerStyle 
                || option.IsUseFrostedGlassBannerStyle)
                    && (option.GetTextBoxPosition() == Position.Left
                        || option.GetTextBoxPosition() == Position.Centre
                        || option.GetTextBoxPosition() == Position.Right))
            {
                designer.ApplyTextWrapping();
            }
            else if (option.IsUseCircleStyle
                     || option.IsUseOutlineStyle)
            {
                designer.ApplyTextWrapping();
            }
            else
            {
                designer.RecoverTextWrapping();
            }

            ApplyTextEffect(option, designer);
            designer.ApplyTextGlowEffect(option.IsUseTextGlow, option.TextGlowColor);

            return new List<Shape>();
        }
        public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            if (option.StyleName != TextCollection.PictureSlidesLabText.StyleNameDirectText
                && option.StyleName != TextCollection.PictureSlidesLabText.StyleNameBlur
                && option.StyleName != TextCollection.PictureSlidesLabText.StyleNameSpecialEffect
                && option.StyleName != TextCollection.PictureSlidesLabText.StyleNameOverlay)
            {
                designer.ApplyPseudoTextWhenNoTextShapes();
            }

            if ((option.IsUseBannerStyle 
                || option.IsUseFrostedGlassBannerStyle)
                    && (option.GetTextBoxPosition() == Position.Left
                        || (option.GetTextBoxPosition() == Position.Centre 
                            && option.GetBannerDirection() != BannerDirection.Horizontal)
                        || option.GetTextBoxPosition() == Position.Right))
            {
                designer.ApplyTextWrapping();
            }
            else if (option.IsUseCircleStyle
                     || option.IsUseOutlineStyle)
            {
                designer.ApplyTextWrapping();
            }
            else
            {
                designer.RecoverTextWrapping(option.GetTextBoxPosition(), option.GetTextAlignment());
            }

            ApplyTextEffect(option, designer);
            designer.ApplyTextGlowEffect(option.IsUseTextGlow, option.TextGlowColor);

            return new List<Shape>();
        }
Пример #3
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            if (option.StyleName != PictureSlidesLabText.StyleNameDirectText &&
                option.StyleName != PictureSlidesLabText.StyleNameBlur &&
                option.StyleName != PictureSlidesLabText.StyleNameSpecialEffect &&
                option.StyleName != PictureSlidesLabText.StyleNameOverlay)
            {
                designer.ApplyPseudoTextWhenNoTextShapes();
            }

            if ((option.IsUseBannerStyle ||
                 option.IsUseFrostedGlassBannerStyle) &&
                (option.GetTextBoxPosition() == Position.Left ||
                 (option.GetTextBoxPosition() == Position.Centre &&
                  option.GetBannerDirection() != BannerDirection.Horizontal) ||
                 option.GetTextBoxPosition() == Position.Right))
            {
                designer.ApplyTextWrapping();
            }
            else if (option.IsUseCircleStyle ||
                     option.IsUseOutlineStyle)
            {
                designer.ApplyTextWrapping();
            }
            else
            {
                designer.RecoverTextWrapping(option.GetTextBoxPosition(), option.GetTextAlignment());
            }

            ApplyTextEffect(option, designer);
            designer.ApplyTextGlowEffect(option.IsUseTextGlow, option.TextGlowColor);

            return(new List <Shape>());
        }
Пример #4
0
        public void TestInsertImageReference()
        {
            // constructor for producing preview image
            var ed = new EffectsDesigner(_processingSlide);

            ed.PreparePreviewing(
                _contentSlide,
                Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight,
                new ImageItem
            {
                ImageFile = "some images",
                Tooltip   = "some tooltips"
            });

            ed.ApplyImageReferenceToSlideNote(Link);
            Assert.IsTrue(
                PpOperations.GetNotesPageText(_processingSlide)
                .Contains(Link));

            ed.ApplyImageReferenceInsertion(Link, "Calibri", "#000000", 14, "", Alignment.Left);
            var refShape = PpOperations.SelectShapesByPrefix(
                EffectsDesigner.ShapeNamePrefix + "_" + EffectName.ImageReference);

            Assert.IsTrue(
                refShape.TextFrame2.TextRange.Text.Contains(Link));
        }
Пример #5
0
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
 {
     if (option.IsUseTextBoxStyle)
     {
         designer.ApplyTextboxEffect(option.TextBoxColor, option.TextBoxTransparency);
     }
     return new List<Shape>();
 }
Пример #6
0
 public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
 {
     if (option.IsUseTextBoxStyle)
     {
         designer.ApplyTextboxEffect(option.TextBoxColor, option.TextBoxTransparency, option.FontSizeIncrease);
     }
     return(new List <Shape>());
 }
Пример #7
0
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source,
     Shape imageShape)
 {
     // store style options information into original image shape
     // return original image and cropped image
     return designer.EmbedStyleOptionsInformation(
         source.OriginalImageFile, source.FullSizeImageFile,
         source.ContextLink, source.Rect, option);
 }
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
 {
     var result = new List<Shape>();
     if (option.IsUseOutlineStyle)
     {
         var outlineOverlayShape = designer.ApplyRectOutlineEffect(imageShape, option.OutlineColor, 0);
         result.Add(outlineOverlayShape);
     }
     return result;
 }
Пример #9
0
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
 {
     var result = new List<Shape>();
     if (option.IsUseCircleStyle)
     {
         var circleOverlayShape = designer.ApplyCircleRingsEffect(option.CircleColor, option.CircleTransparency);
         result.Add(circleOverlayShape);
     }
     return result;
 }
Пример #10
0
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
 {
     var result = new List<Shape>();
     if (option.IsUseOverlayStyle)
     {
         var backgroundOverlayShape = designer.ApplyOverlayEffect(option.OverlayColor, option.Transparency);
         result.Add(backgroundOverlayShape);
     }
     return result;
 }
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
 {
     designer.ApplyImageReference(source.ContextLink);
     if (option.IsInsertReference)
     {
         designer.ApplyImageReferenceInsertion(source.ContextLink, option.GetFontFamily(), option.FontColor,
             option.CitationFontSize, option.ImageReferenceTextBoxColor, option.GetCitationTextBoxAlignment());
     }
     return new List<Shape>();
 }
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
 {
     var result = new List<Shape>();
     if (option.IsUseFrameStyle)
     {
         var frameOverlayShape = designer.ApplyAlbumFrameEffect(option.FrameColor, option.FrameTransparency);
         result.Add(frameOverlayShape);
     }
     return result;
 }
Пример #13
0
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
 {
     var result = new List<Shape>();
     if (option.IsUseBannerStyle)
     {
         var bannerOverlayShape = ApplyBannerStyle(option, designer, imageShape);
         result.Add(bannerOverlayShape);
     }
     return result;
 }
Пример #14
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            List <Shape> result = new List <Shape>();

            if (option.IsUseCircleStyle)
            {
                Shape circleOverlayShape = designer.ApplyCircleRingsEffect(option.CircleColor, option.CircleTransparency);
                result.Add(circleOverlayShape);
            }
            return(result);
        }
Пример #15
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            List <Shape> result = new List <Shape>();

            if (option.IsUseBannerStyle)
            {
                Shape bannerOverlayShape = ApplyBannerStyle(option, designer, imageShape);
                result.Add(bannerOverlayShape);
            }
            return(result);
        }
Пример #16
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            List <Shape> result = new List <Shape>();

            if (option.IsUseOverlayStyle)
            {
                Shape backgroundOverlayShape = designer.ApplyOverlayEffect(option.OverlayColor, option.OverlayTransparency);
                result.Add(backgroundOverlayShape);
            }
            return(result);
        }
Пример #17
0
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
 {
     var result = new List<Shape>();
     if (option.IsUseTriangleStyle)
     {
         var triangleOverlayShape = designer.ApplyTriangleEffect(option.TriangleColor, option.FontColor,
             option.TriangleTransparency);
         result.Add(triangleOverlayShape);
     }
     return result;
 }
Пример #18
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            List <Shape> result = new List <Shape>();

            if (option.IsUseOutlineStyle)
            {
                Shape outlineOverlayShape = designer.ApplyRectOutlineEffect(imageShape, option.OutlineColor, 0);
                result.Add(outlineOverlayShape);
            }
            return(result);
        }
Пример #19
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            List <Shape> result = new List <Shape>();

            if (option.IsUseFrameStyle)
            {
                Shape frameOverlayShape = designer.ApplyAlbumFrameEffect(option.FrameColor, option.FrameTransparency);
                result.Add(frameOverlayShape);
            }
            return(result);
        }
Пример #20
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            var result = new List <Shape>();

            if (option.IsUseTriangleStyle)
            {
                var triangleOverlayShape = designer.ApplyTriangleEffect(option.TriangleColor, option.FontColor,
                                                                        option.TriangleTransparency);
                result.Add(triangleOverlayShape);
            }
            return(result);
        }
Пример #21
0
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
 {
     var result = new List<Shape>();
     if (option.IsUseBlurStyle)
     {
         var blurImageShape = option.IsUseSpecialEffectStyle
             ? designer.ApplyBlurEffect(source.SpecialEffectImageFile, option.BlurDegree)
             : designer.ApplyBlurEffect(degree: option.BlurDegree);
         result.Add(blurImageShape);
     }
     return result;
 }
Пример #22
0
 private void ApplyTextEffect(StyleOption option, EffectsDesigner effectsDesigner)
 {
     if (option.IsUseTextFormat)
     {
         effectsDesigner.ApplyTextEffect(option.GetFontFamily(), option.FontColor, option.FontSizeIncrease);
         effectsDesigner.ApplyTextPositionAndAlignment(option.GetTextBoxPosition(), option.GetTextAlignment());
     }
     else
     {
         effectsDesigner.ApplyOriginalTextEffect();
         effectsDesigner.ApplyTextPositionAndAlignment(Position.Original, Alignment.Auto);
     }
 }
Пример #23
0
 public void Init()
 {
     _contentSlide    = PpOperations.SelectSlide(1);
     _processingSlide = PpOperations.SelectSlide(2);
     _imgItem         = new ImageItem
     {
         ImageFile = Img,
         Tooltip   = "some tooltips"
     };
     _designer = new EffectsDesigner(_contentSlide,
                                     Pres.PageSetup.SlideWidth, Pres.PageSetup.SlideHeight,
                                     _imgItem);
 }
Пример #24
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            List <Shape> result = new List <Shape>();

            if (option.IsUseBlurStyle)
            {
                Shape blurImageShape = option.IsUseSpecialEffectStyle
                    ? designer.ApplyBlurEffect(source.SpecialEffectImageFile, option.BlurDegree)
                    : designer.ApplyBlurEffect(degree: option.BlurDegree);
                result.Add(blurImageShape);
            }
            return(result);
        }
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
 {
     // in previewing 
     if (source.FullSizeImageFile == null)
     {
         return new List<Shape>();
     }
     // store style options information into original image shape
     // return original image and cropped image
     return designer.EmbedStyleOptionsInformation(
         source.BackupFullSizeImageFile, source.FullSizeImageFile,
         source.ContextLink, source.Source, source.Rect, option);
 }
 public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
 {
     // in previewing
     if (source.FullSizeImageFile == null)
     {
         return(new List <Shape>());
     }
     // store style options information into original image shape
     // return original image and cropped image
     return(designer.EmbedStyleOptionsInformation(
                source.BackupFullSizeImageFile, source.FullSizeImageFile,
                source.ContextLink, source.Source, source.Rect, option));
 }
Пример #27
0
 public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
 {
     if (option.IsUseFrostedGlassTextBoxStyle)
     {
         var blurDegreeForFrostedGlass = EffectsDesigner.BlurDegreeForFrostedGlassEffect;
         var blurImageShape            = option.IsUseSpecialEffectStyle
             ? designer.ApplyBlurEffect(source.SpecialEffectImageFile, blurDegreeForFrostedGlass)
             : designer.ApplyBlurEffect(degree: blurDegreeForFrostedGlass);
         designer.ApplyFrostedGlassTextBoxEffect(option.FrostedGlassTextBoxColor, option.FrostedGlassTextBoxTransparency,
                                                 blurImageShape, option.FontSizeIncrease);
         blurImageShape.Delete();
     }
     return(new List <Shape>());
 }
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
 {
     if (option.IsUseFrostedGlassTextBoxStyle)
     {
         var blurDegreeForFrostedGlass = EffectsDesigner.BlurDegreeForFrostedGlassEffect;
         var blurImageShape = option.IsUseSpecialEffectStyle
             ? designer.ApplyBlurEffect(source.SpecialEffectImageFile, blurDegreeForFrostedGlass)
             : designer.ApplyBlurEffect(degree: blurDegreeForFrostedGlass);
         designer.ApplyFrostedGlassTextBoxEffect(option.FrostedGlassTextBoxColor, option.FrostedGlassTextBoxTransparency,
             blurImageShape, option.FontSizeIncrease);
         blurImageShape.Delete();
     }
     return new List<Shape>();
 }
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape)
 {
     var result = new List<Shape>();
     if (option.IsUseFrostedGlassBannerStyle)
     {
         var blurDegreeForFrostedGlass = EffectsDesigner.BlurDegreeForFrostedGlassEffect;
         var blurImageShape = option.IsUseSpecialEffectStyle
             ? designer.ApplyBlurEffect(source.SpecialEffectImageFile, blurDegreeForFrostedGlass)
             : designer.ApplyBlurEffect(degree: blurDegreeForFrostedGlass);
         var banner = designer.ApplyFrostedGlassBannerEffect(option.GetBannerDirection(), option.GetTextBoxPosition(),
             blurImageShape, option.FrostedGlassBannerColor, option.FrostedGlassBannerTransparency);
         result.Add(banner);
         blurImageShape.Delete();
     }
     return result;
 }
 public IList<Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
 {
     designer.ApplyImageReference(source.Source);
     if (settings != null && settings.IsInsertCitation)
     {
         designer.ApplyImageReferenceInsertion(source.Source, "Calibri", settings.CitationFontColor,
             settings.CitationFontSize, 
             settings.IsUseCitationTextBox ? settings.CitationTextBoxColor : "", 
             settings.GetCitationTextBoxAlignment());
     }
     else if (option.IsInsertReference)
     {
         designer.ApplyImageReferenceInsertion(source.Source, option.GetFontFamily(), option.FontColor,
             option.CitationFontSize, option.ImageReferenceTextBoxColor, option.GetCitationTextBoxAlignment());
     }
     return new List<Shape>();
 }
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            List <Shape> result = new List <Shape>();

            if (option.IsUseFrostedGlassBannerStyle)
            {
                int   blurDegreeForFrostedGlass = EffectsDesigner.BlurDegreeForFrostedGlassEffect;
                Shape blurImageShape            = option.IsUseSpecialEffectStyle
                    ? designer.ApplyBlurEffect(source.SpecialEffectImageFile, blurDegreeForFrostedGlass)
                    : designer.ApplyBlurEffect(degree: blurDegreeForFrostedGlass);
                Shape banner = designer.ApplyFrostedGlassBannerEffect(option.GetBannerDirection(), option.GetTextBoxPosition(),
                                                                      blurImageShape, option.FrostedGlassBannerColor, option.FrostedGlassBannerTransparency);
                result.Add(banner);
                blurImageShape.SafeDelete();
            }
            return(result);
        }
Пример #32
0
        public IList <Shape> Execute(StyleOption option, EffectsDesigner designer, ImageItem source, Shape imageShape, Settings settings)
        {
            if (settings != null && settings.IsInsertCitation)
            {
                designer.ApplyImageReferenceInsertion(source.Source, "Calibri", settings.CitationFontColor,
                                                      settings.CitationFontSize,
                                                      settings.IsUseCitationTextBox ? settings.CitationTextBoxColor : "",
                                                      settings.GetCitationTextBoxAlignment());
            }

            if (settings != null && settings.IsInsertCitationToNote)
            {
                designer.ApplyImageReferenceToSlideNote(source.Source);
            }
            else
            {
                designer.RemoveImageReference();
            }
            return(new List <Shape>());
        }
Пример #33
0
 private void ApplyTextEffect(StyleOption option, EffectsDesigner effectsDesigner)
 {
     effectsDesigner.ApplyTextEffect(option.GetFontFamily(), option.FontColor, option.FontSizeIncrease,
                                     option.TextTransparency);
     effectsDesigner.ApplyTextPositionAndAlignment(option.GetTextBoxPosition(), option.GetTextAlignment());
 }
Пример #34
0
 private void ApplyTextEffect(StyleOption option, EffectsDesigner effectsDesigner)
 {
     effectsDesigner.ApplyTextEffect(option.GetFontFamily(), option.FontColor, option.FontSizeIncrease);
     effectsDesigner.ApplyTextPositionAndAlignment(option.GetTextBoxPosition(), option.GetTextAlignment());
 }
Пример #35
0
 private Shape ApplyBannerStyle(StyleOption option, EffectsDesigner effectsDesigner, Shape imageShape)
 {
     return effectsDesigner.ApplyRectBannerEffect(option.GetBannerDirection(), option.GetTextBoxPosition(),
                 imageShape, option.BannerColor, option.BannerTransparency);
 }
Пример #36
0
 private Shape ApplyBannerStyle(StyleOption option, EffectsDesigner effectsDesigner, Shape imageShape)
 {
     return(effectsDesigner.ApplyRectBannerEffect(option.GetBannerDirection(), option.GetTextBoxPosition(),
                                                  imageShape, option.BannerColor, option.BannerTransparency));
 }