public static PowerPoint.Shape GenerateTriggerShape(PowerPointSlide currentSlide) { PowerPoint.Shape triggerShape = currentSlide.Shapes.AddShape( Microsoft.Office.Core.MsoAutoShapeType.msoShapeOval, TooltipsLabConstants.TriggerShapeDefaultLeft, TooltipsLabConstants.TriggerShapeDefaultTop, TooltipsLabConstants.TriggerShapeDefaultWidth, TooltipsLabConstants.TriggerShapeDefaultHeight); ShapeUtil.FormatTriggerShapeToDefaultStyle(triggerShape); return(triggerShape); }
// Generate a trigger shape directly in the center bottom position of the specified callout shape. public static PowerPoint.Shape GenerateTriggerShapeWithReferenceCallout(PowerPointSlide currentSlide, PowerPoint.Shape callout) { float left = ShapeUtil.GetCenterPoint(callout).X - TooltipsLabConstants.TriggerShapeDefaultWidth / 2; float top = ShapeUtil.GetBottom(callout) + TooltipsLabConstants.TriggerShapeAndCalloutSpacing; PowerPoint.Shape triggerShape = currentSlide.Shapes.AddShape( TooltipsLabConstants.TriggerShape, left, top, TooltipsLabConstants.TriggerShapeDefaultWidth, TooltipsLabConstants.TriggerShapeDefaultHeight); ShapeUtil.FormatTriggerShapeToDefaultStyle(triggerShape); return(triggerShape); }
public static PowerPoint.Shape GenerateTriggerShape( PowerPointPresentation presentation, PowerPointSlide currentSlide) { PowerPoint.Shape triggerShape = currentSlide.Shapes.AddShape( Microsoft.Office.Core.MsoAutoShapeType.msoShapeOval, TooltipsLabConstants.TriggerShapeDefaultLeft, TooltipsLabConstants.TriggerShapeDefaultTop, TooltipsLabConstants.TriggerShapeDefaultWidth, TooltipsLabConstants.TriggerShapeDefaultHeight); ShapeUtil.FormatTriggerShapeToDefaultStyle(triggerShape); // Look for a shape on the same position of the same size and type on the same slide float blurRadius = Math.Min(TooltipsLabConstants.TriggerShapeDefaultWidth, TooltipsLabConstants.TriggerShapeDefaultHeight) / 2; triggerShape.TryDisplaceShape(presentation, currentSlide, blurRadius); return(triggerShape); }