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


C# PowerPoint.Shape类代码示例

本文整理汇总了C#中Microsoft.Office.Interop.PowerPoint.Shape的典型用法代码示例。如果您正苦于以下问题:C# Shape类的具体用法?C# Shape怎么用?C# Shape使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Shape类属于Microsoft.Office.Interop.PowerPoint命名空间,在下文中一共展示了Shape类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrepareForZoomToArea

        private void PrepareForZoomToArea(PowerPoint.Shape zoomShape)
        {
            MoveMotionAnimation();

            //Delete zoom shapes and shapes with exit animations
            List<PowerPoint.Shape> shapes = _slide.Shapes.Cast<PowerPoint.Shape>().ToList();
            var matchingShapes = shapes.Where(current => (HasExitAnimation(current) || current.Equals(zoomShape)));
            foreach (PowerPoint.Shape s in matchingShapes)
                s.Delete();

            AddZoomSlideCroppedPicture();

            DeleteSlideNotes();
            DeleteSlideMedia();
            ManageSlideTransitions();
            indicatorShape = AddPowerPointLabsIndicator();

            //Add fade out effect for non-zoom shapes
            shapes = _slide.Shapes.Cast<PowerPoint.Shape>().ToList();
            matchingShapes = shapes.Where(current => (!(current.Equals(indicatorShape) || current.Equals(zoomSlideCroppedShapes))));
            foreach (PowerPoint.Shape s in matchingShapes)
            {
                DeleteShapeAnimations(s);
                if (!ZoomToArea.backgroundZoomChecked)
                {
                    PowerPoint.Effect effectFade = _slide.TimeLine.MainSequence.AddEffect(s, PowerPoint.MsoAnimEffect.msoAnimEffectFade, PowerPoint.MsoAnimateByLevel.msoAnimateLevelNone, PowerPoint.MsoAnimTriggerType.msoAnimTriggerWithPrevious);
                    effectFade.Exit = Office.MsoTriState.msoTrue;
                    effectFade.Timing.Duration = 0.25f;
                }
                else
                    s.Visible = Office.MsoTriState.msoFalse;
            }
        }
开发者ID:oswellchan,项目名称:PowerPointLabs,代码行数:33,代码来源:PowerPointMagnifyingSlide.cs

示例2: ExtractFormats

 /// <summary>
 /// Assumes the number of paragraphs >= 3.
 /// The check should have been done before this function is called.
 /// </summary>
 public static BulletFormats ExtractFormats(Shape contentShape)
 {
     var paragraphs = contentShape.TextFrame2.TextRange.Paragraphs.Cast<TextRange2>().ToList();
     return new BulletFormats(paragraphs[0],
                             paragraphs[1],
                             paragraphs[2]);
 }
开发者ID:oswellchan,项目名称:PowerPointLabs,代码行数:11,代码来源:AgendaLabMain.cs

示例3: PrepareForZoomToArea

        private void PrepareForZoomToArea(PowerPointSlide slideToPanFrom, PowerPointSlide slideToPanTo)
        {
            //Delete all shapes from slide excpet last magnified shape
            List<PowerPoint.Shape> shapes = _slide.Shapes.Cast<PowerPoint.Shape>().ToList();
            var matchingShapes = shapes.Where(current => (!current.Name.Contains("PPTLabsMagnifyAreaGroup")));
            foreach (PowerPoint.Shape s in matchingShapes)
                s.Delete();

            panShapeFrom = GetShapesWithPrefix("PPTLabsMagnifyAreaGroup")[0];
            panShapeTo = slideToPanTo.GetShapesWithPrefix("PPTLabsMagnifyAreaGroup")[0];

            //Add fade animation to existing shapes
            shapes = _slide.Shapes.Cast<PowerPoint.Shape>().ToList();
            matchingShapes = shapes.Where(current => (!(current.Equals(indicatorShape) || current.Equals(panShapeFrom))));
            foreach (PowerPoint.Shape s in matchingShapes)
            {
                DeleteShapeAnimations(s);
                PowerPoint.Effect effectFade = _slide.TimeLine.MainSequence.AddEffect(s, PowerPoint.MsoAnimEffect.msoAnimEffectFade, PowerPoint.MsoAnimateByLevel.msoAnimateLevelNone, PowerPoint.MsoAnimTriggerType.msoAnimTriggerWithPrevious);
                effectFade.Exit = Office.MsoTriState.msoTrue;
                effectFade.Timing.Duration = 0.25f;
            }

            DeleteSlideNotes();
            DeleteSlideMedia();
            ManageSlideTransitions();
            indicatorShape = AddPowerPointLabsIndicator();
        }
开发者ID:suheti,项目名称:powerpointlabs,代码行数:27,代码来源:PowerPointMagnifiedPanSlide.cs

示例4: TildaShape

 /**
  * Creates a new TildaShape Object from a powerpoint shape
  * @param PowerPoint.Shape
  */
 public TildaShape(PowerPoint.Shape shape, int id = 0)
 {
     this.shape = shape;
     this.scaler = Settings.Scaler();
     this.id = id;
     animations = new List<TildaAnimation>();
 }
开发者ID:parris,项目名称:tilda,代码行数:11,代码来源:TildaShape.cs

示例5: ExportShape

        public static void ExportShape(Shape shape, string exportPath)
        {
            var slideWidth = (int)PowerPointPresentation.Current.SlideWidth;
            var slideHeight = (int)PowerPointPresentation.Current.SlideHeight;

            shape.Export(exportPath, PpShapeFormat.ppShapeFormatPNG, slideWidth,
                         slideHeight, PpExportMode.ppScaleToFit);
        }
开发者ID:youthinkk,项目名称:PowerPointLabs,代码行数:8,代码来源:Graphics.cs

示例6: FitShapeToSlide

 public static void FitShapeToSlide(ref Shape shapeToMove)
 {
     shapeToMove.LockAspectRatio = MsoTriState.msoFalse;
     shapeToMove.Left = 0;
     shapeToMove.Top = 0;
     shapeToMove.Width = PowerPointPresentation.Current.SlideWidth;
     shapeToMove.Height = PowerPointPresentation.Current.SlideHeight;
 }
开发者ID:youthinkk,项目名称:PowerPointLabs,代码行数:8,代码来源:Graphics.cs

示例7: DeleteTag

 private static void DeleteTag(Shape shp)
 {
     if (shp.Tags.Count > 0)
     {
         for (int i = shp.Tags.Count - 1; i >= 0; i--)
         {
             string name = shp.Tags.Name(i);
             shp.Tags.Delete(name);
         }
     }
 }
开发者ID:kahn520,项目名称:App,代码行数:11,代码来源:Program.cs

示例8: IsCorrupted

 public static bool IsCorrupted(Shape shape)
 {
     try
     {
         return shape.Parent == null;
     }
     catch (Exception)
     {
         return true;
     }
 }
开发者ID:youthinkk,项目名称:PowerPointLabs,代码行数:11,代码来源:Graphics.cs

示例9: IsSamePosition

        public static bool IsSamePosition(Shape refShape, Shape candidateShape,
                                          bool exactMatch = true, float blurRadius = float.Epsilon)
        {
            if (exactMatch)
            {
                blurRadius = float.Epsilon;
            }

            return refShape != null &&
                   candidateShape != null &&
                   Math.Abs(refShape.Left - candidateShape.Left) < blurRadius &&
                   Math.Abs(refShape.Top - candidateShape.Top) < blurRadius;
        }
开发者ID:youthinkk,项目名称:PowerPointLabs,代码行数:13,代码来源:Graphics.cs

示例10: DeleteText

 private static void DeleteText(Shape shp)
 {
     if(shp.TextFrame.HasText == MsoTriState.msoFalse)
         return;
     if(shp.TextFrame.TextRange.Text.Trim() == "")
         return;
     //if (shp.Type == MsoShapeType.msoPlaceholder)
     //{
     //    shp.TextFrame.TextRange.Delete();
     //    return;
     //}
     if(HasChinese(shp.TextFrame.TextRange.Text))
         shp.TextFrame.TextRange.Delete();
 }
开发者ID:kahn520,项目名称:App,代码行数:14,代码来源:Program.cs

示例11: PPShape

        public PPShape(PowerPoint.Shape shape, bool redefineBoundingBox = true)
        {
            _shape = shape;
            _originalRotation = _shape.Rotation;

            if (redefineBoundingBox && (int) _shape.Rotation%90 != 0)
            {
                ConvertToFreeform();
            }

            UpdateAbsoluteWidth();
            UpdateAbsoluteHeight();

            UpdateVisualTop();
            UpdateVisualLeft();
        }
开发者ID:nus-fboa2016-PL,项目名称:PowerPointLabs,代码行数:16,代码来源:PPShape.API.cs

示例12: AddZoomSlideCroppedPicture

        //Stores slide-size crop of the current slide as a global variable
        private void AddZoomSlideCroppedPicture()
        {
            PowerPointSlide zoomSlideCopy = this.Duplicate();
            Globals.ThisAddIn.Application.ActiveWindow.View.GotoSlide(zoomSlideCopy.Index);

            PowerPoint.Shape cropShape = zoomSlideCopy.Shapes.AddShape(Office.MsoAutoShapeType.msoShapeRectangle, 0, 0, PowerPointPresentation.Current.SlideWidth - 0.01f, PowerPointPresentation.Current.SlideHeight - 0.01f);
            cropShape.Select();
            PowerPoint.Selection sel = Globals.ThisAddIn.Application.ActiveWindow.Selection;
            PowerPoint.Shape croppedShape = CropToShape.Crop(sel);
            croppedShape.Cut();

            zoomSlideCroppedShapes = _slide.Shapes.PasteSpecial(PowerPoint.PpPasteDataType.ppPastePNG)[1];
            zoomSlideCroppedShapes.Name = "PPTLabsMagnifyAreaGroup" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
            Utils.Graphics.FitShapeToSlide(ref zoomSlideCroppedShapes);
            zoomSlideCopy.Delete();
        }
开发者ID:suheti,项目名称:powerpointlabs,代码行数:17,代码来源:PowerPointMagnifyingSlide.cs

示例13: PrepareForZoomToArea

        private void PrepareForZoomToArea()
        {
            //Delete all shapes on slide except slide-size crop copied from magnifying slide
            List<PowerPoint.Shape> shapes = _slide.Shapes.Cast<PowerPoint.Shape>().ToList();
            var matchingShapes = shapes.Where(current => (!current.Name.Contains("PPTLabsMagnifyAreaGroup")));
            foreach (PowerPoint.Shape s in matchingShapes)
                s.Delete();

            zoomSlideCroppedShapes = GetShapesWithPrefix("PPTLabsMagnifyAreaGroup")[0];
            zoomSlideCroppedShapes.Visible = Office.MsoTriState.msoTrue;
            DeleteShapeAnimations(zoomSlideCroppedShapes);

            DeleteSlideNotes();
            DeleteSlideMedia();
            ManageSlideTransitions();
            indicatorShape = AddPowerPointLabsIndicator();
        }
开发者ID:suheti,项目名称:powerpointlabs,代码行数:17,代码来源:PowerPointMagnifiedSlide.cs

示例14: monthCalendar1_DateChanged

        private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
        {
            try
            {
                if (textbox != null)
                {
                    textbox.Delete();
                }
                PowerPoint.Slide slide = Globals.ThisAddIn.Application.ActivePresentation.Slides[1];
                textbox = slide.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal, 50, 100, 600, 50);
                textbox.TextFrame.TextRange.Text = e.Start.ToLongDateString();
                textbox.TextFrame.TextRange.Font.Size = 48;
                textbox.TextFrame.TextRange.Font.Color.RGB = Color.DarkViolet.ToArgb();
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.ToString());
            }
        }
开发者ID:caerang,项目名称:TIL,代码行数:20,代码来源:MyUserControl.cs

示例15: GetShapeWithSameIDAndName

 public Shape GetShapeWithSameIDAndName(Shape shapeToMatch)
 {
     Shape tempMatchingShape = null;
     foreach (Shape sh in _slide.Shapes)
     {
         if (shapeToMatch.Id == sh.Id && HaveSameNames(shapeToMatch, sh))
         {
             if (tempMatchingShape == null)
                 tempMatchingShape = sh;
             else
             {
                 if (GetDistanceBetweenShapes(shapeToMatch, sh) < GetDistanceBetweenShapes(shapeToMatch, tempMatchingShape))
                     tempMatchingShape = sh;
             }
         }
     }
     return tempMatchingShape;
 }
开发者ID:nus-fboa2016-PL,项目名称:PowerPointLabs,代码行数:18,代码来源:PowerPointSlide.cs


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