예제 #1
0
        public static PowerPoint.Shape GenerateCalloutWithReferenceTriggerShape(PowerPointSlide currentSlide, PowerPoint.Shape triggerShape)
        {
            float midpointX = ShapeUtil.GetMidpointX(triggerShape);


            PowerPoint.Shape callout = currentSlide.Shapes.AddShape(
                TooltipsLabSettings.ShapeType,
                midpointX - TooltipsLabConstants.CalloutShapeDefaultWidth / 2 + (float)(TooltipsLabConstants.CalloutArrowheadHorizontalAdjustment * TooltipsLabConstants.CalloutShapeDefaultWidth),
                triggerShape.Top - (float)(TooltipsLabConstants.CalloutArrowheadVerticalAdjustment * TooltipsLabConstants.CalloutShapeDefaultHeight) - TooltipsLabConstants.TriggerShapeAndCalloutSpacing,
                TooltipsLabConstants.CalloutShapeDefaultWidth,
                TooltipsLabConstants.CalloutShapeDefaultHeight);
            ShapeUtil.FormatCalloutToDefaultStyle(callout);

            callout.TextFrame2.AutoSize  = MsoAutoSize.msoAutoSizeTextToFitShape;
            callout.TextEffect.Alignment = MsoTextEffectAlignment.msoTextEffectAlignmentCentered;

            return(callout);
        }