public void addShapeToCurrSlide(Microsoft.Office.Core.MsoAutoShapeType shapeType, float x, float y, float width, float height) { pptApp.ActivePresentation.Slides[getCurSlide()]. Shapes.AddShape( shapeType, x, y, width, height ); }
private void SetShapeType() { ShapeType = Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle; if (Parameters.Algorithm == TreemapAlgorithm.Circular) { ShapeType = Microsoft.Office.Core.MsoAutoShapeType.msoShapeOval; } }
/// <summary> /// paste acts just like the real paste. It adds a shape of the specified MsoAutoShapeType at /// the specified location with the specified dimension. This is implemented because there /// is no built in paste for the Shape object that we are interested in /// </summary> /// <param name="type">the type of the shape</param> /// <param name="x">x coordinate</param> /// <param name="y">y coordinate</param> /// <param name="width">width of the shape</param> /// <param name="height">height of the shape</param> /// <returns></returns> public PowerPoint.Shape paste(Microsoft.Office.Core.MsoAutoShapeType type, int x, int y, float width, float height, int color, float angle) { int XCORRECTION = 5; PowerPoint.Slide slide = pptApp.ActivePresentation.Slides[getCurSlide()]; PowerPoint.Shape shape = slide.Shapes.AddShape(type, (float)(x + XCORRECTION), y, (int)width, (int)height); shape.Fill.ForeColor.RGB = color; shape.Rotation = angle; return(shape); }
internal void GenerateProgressBar() { if (PresentationSlides.Count == 0 || HiddenSlidesCount >= PresentationSlides.Count) { TreatNoSlidesFoundError(); return; } Microsoft.Office.Core.MsoAutoShapeType shapeBackground = Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle; Microsoft.Office.Core.MsoAutoShapeType shapeForeground = Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle; int stepCounter = 1; SolidBar.Instance.CountOfSteps = PresentationSlides.Count - HiddenSlidesCount; SolidBar.Instance.SetStepWidth(SlideWidth); SlideProperties.Instance.Height = SlideHeight; SlideProperties.Instance.Width = SlideWidth; float stepWidth = SolidBar.Instance.StepWidth; float topMargin = SolidBar.GetTopMargin(); if (currentTheme == ProgressBar.DataStructs.Theme.DOTTED) { if (SolidBar.Instance.Alignment == BarAlign.TOP) { topMargin = topMargin + 5; } else { topMargin = topMargin - 5; } } foreach (Slide oneSlide in PresentationSlides) { Shape addedShapeBackground, addedShapeForeground; if (SolidBar.DisableOnFirstSlide && stepCounter == 1 && oneSlide.SlideShowTransition.Hidden == Microsoft.Office.Core.MsoTriState.msoFalse) { stepCounter++; continue; } if (oneSlide.SlideShowTransition.Hidden == Microsoft.Office.Core.MsoTriState.msoTrue) { continue; } if (currentTheme == ProgressBar.DataStructs.Theme.DOTTED) { int margin = ((int)SlideWidth - (int)(SolidBar.Instance.CountOfSteps * SolidBar.Instance.Height)) / SolidBar.Instance.CountOfSteps; for (int i = 0; i < SolidBar.Instance.CountOfSteps; i++) { if ((stepCounter - 1) == i) { addedShapeBackground = oneSlide.Shapes.AddShape(shapeForeground, 5 + (5 * i) + (i * SolidBar.Instance.Height), topMargin, SolidBar.Instance.Height, SolidBar.Instance.Height); addedShapeBackground.Fill.ForeColor.RGB = SolidBar.BackgroundOLE; addedShapeBackground.Line.Weight = 0; addedShapeBackground.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; addedShapeBackground.Name = SolidBar.SHAPE_NAME + SolidBar.BG_SUFFIX; } else { addedShapeForeground = oneSlide.Shapes.AddShape(shapeForeground, 5 + (5 * i) + (i * SolidBar.Instance.Height), topMargin, SolidBar.Instance.Height, SolidBar.Instance.Height); addedShapeForeground.Fill.ForeColor.RGB = SolidBar.ForegroundOLE; addedShapeForeground.Line.Weight = 0; addedShapeForeground.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; addedShapeForeground.Name = SolidBar.SHAPE_NAME + SolidBar.BAR_SUFFIX; } } } else { addedShapeBackground = oneSlide.Shapes.AddShape(shapeBackground, 0, topMargin, SlideWidth, SolidBar.Instance.Height); addedShapeForeground = oneSlide.Shapes.AddShape(shapeForeground, 0, topMargin, stepWidth * stepCounter, SolidBar.Instance.Height); addedShapeBackground.Name = SolidBar.SHAPE_NAME + SolidBar.BG_SUFFIX; addedShapeForeground.Name = SolidBar.SHAPE_NAME + SolidBar.BAR_SUFFIX; addedShapeBackground.Line.Weight = addedShapeForeground.Line.Weight = 0; addedShapeBackground.Line.Visible = addedShapeForeground.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; addedShapeBackground.Fill.ForeColor.RGB = SolidBar.BackgroundOLE; addedShapeForeground.Fill.ForeColor.RGB = SolidBar.ForegroundOLE; } stepCounter++; } HasProgressBar = true; }
private static void OnSettingsDialogConfirmed(MsoAutoShapeType newShapeType, MsoAnimEffect newAnimationType) { ShapeType = newShapeType; AnimationType = newAnimationType; }
public Shape AddShape(Microsoft.Office.Core.MsoAutoShapeType Type, float Left, float Top, float Width, float Height) { throw new NotImplementedException(); }
private void SetShapeType() { ShapeType = Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle; if (Parameters.Algorithm == TreemapAlgorithm.Circular) ShapeType = Microsoft.Office.Core.MsoAutoShapeType.msoShapeOval; }