How to set ShapeTypeEx.RoundCornerRectangle Corner Radius

Hello,

I can’t find any information about setting the corner radius for a rounded rectangle shape.
How can I set the radius?

Thanks

Hi Daniel,


Thanks for inquiring Aspose.Slides.

I have observed your requirements and I guess you are trying to set the arc radius for the shape. Please visit this thread link for your convenience and share with us if there is any further help I may offer you in this regard.

Many Thanks,

Hello Mudassir,

it’s not completely clear what value to set exactly, but thanks for the link.

Hi Daniel,


I like to share that an issue with ID SLIDESNET-34157 has already been created in our issue tracking system to investigate the issue of mapping of set arc values between Aspose.Slides and PowerPoint. I will be able to share the further feedback with you in this regard as soon as it will be shared by our development team.

Many Thanks,

Hi Daniel,

Our development team has worked over the requirement shared and suggested the mapping that can be used with two types of shapes mentioned by you in sample presentation. In PowerPoint the Adjustment value ranges from 0 to 1. We have provided the mapping for Aspose.Slides that you can use on your end to set the respective adjustment values.


public static void ModifyArcSize()
{
try
{
string path = @“D:\Aspose Data”;
string filename = path + “arcsize.pptx”;
PresentationEx p = new PresentationEx(filename);
// Debug.Assert(1 == p.Slides.Count);
SlideEx s = p.Slides[0];
Debug.Assert(null != s);
Debug.Assert(1 == s.Shapes.Count);
AutoShapeEx shape = s.Shapes[0] as AutoShapeEx;
Debug.Assert(null != shape);

Debug.Assert(1 == shape.Adjustments.Count);
AdjustValueEx av = shape.Adjustments[0];
Debug.Assert(null != av);
Console.WriteLine(“RawValue={0}; AngleValue={1}; Name=”{2}"", av.RawValue, av.AngleValue, av.Name);

double shapeHeight = shape.Height;
double shapeWidth = shape.Width;
double FrendlyValue = (double)av.RawValue * (shapeHeight / Math.Max(shapeWidth, shapeHeight)) / 50000;
double RawValue = (double)FrendlyValue * 50000 / (shapeHeight / Math.Max(shapeWidth, shapeHeight));

s = p.Slides[1];
Debug.Assert(null != s);
Debug.Assert(1 == s.Shapes.Count);
shape = s.Shapes[0] as AutoShapeEx;
Debug.Assert(null != shape);

Debug.Assert(1 == shape.Adjustments.Count);
AdjustValueEx av2 = shape.Adjustments[0];
Debug.Assert(null != av2);
Console.WriteLine(“RawValue={0}; AngleValue={1}; Name=”{2}"", av2.RawValue, av2.AngleValue, av2.Name);

//The mapping for the particular case of Trapezoid preset shape type.
//RawValue values range is [0, 50000*(max(shapeWidth, shapeHeight)/shapeHeight)]
//Let FrendlyValue is RawValue scaled to [0,1] range. Then
shapeHeight = shape.Height;
shapeWidth = shape.Width;

FrendlyValue=(double)av2.RawValue*(shapeHeight/Math.Max(shapeWidth, shapeHeight))/50000;
RawValue = (double)FrendlyValue * 50000 / (shapeHeight / Math.Max(shapeWidth, shapeHeight));


s = p.Slides[2];
Debug.Assert(null != s);
Debug.Assert(1 == s.Shapes.Count);
shape = s.Shapes[0] as AutoShapeEx;
Debug.Assert(null != shape);

Debug.Assert(1 == shape.Adjustments.Count);
AdjustValueEx av3 = shape.Adjustments[0];
Debug.Assert(null != av3);
Console.WriteLine(“RawValue={0}; AngleValue={1}; Name=”{2}"", av3.RawValue, av3.AngleValue, av3.Name);


//2) The mapping for the particular case of RoundCornerRectangle preset shape type.
// RawValue values range is [0, 50000]
//Let FrendlyValue is RawValue scaled to [0,1] range. Then
FrendlyValue=(double)av3.RawValue/50000;
RawValue=FrendlyValue*50000;

}
catch (Exception e)
{

}

}

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-34157) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.