Page 1 of 1

rounded edges in Border of StiText

Posted: Thu Mar 09, 2017 6:32 am
by Prandl33
Hello,
how I get rounded edges for the Border of a StiText-Objekt?
Thank you

Re: rounded edges in Border of StiText

Posted: Thu Mar 09, 2017 9:57 pm
by Alex K.
Hello,

Please try to use the Rounded Rectangle Primitive component for this task.

Thank you.

Re: rounded edges in Border of StiText

Posted: Mon Mar 13, 2017 6:33 am
by Prandl33
Hello Aleksey,
thank you for your reply.
My problem is that I have to adjust depending on the length of the text. Now here is the solution.
title.PNG
title.PNG (4.05 KiB) Viewed 4119 times
In the PrintBefore-Event of the shape "TitleFrame" with rounded edges I use the following code:

Code: Select all

double widthTitle = Title.Render().GetActualSize().Width;
double beginTitle = (Page1.Width - widthTitle) / 2.0; 
TitleFrame.Left = beginTitle - 0.5;
TitleFrame.Width = widthTitle + 1.0;
Title.Left = beginTitle + 1.0;
The text should also be in the center of the page.

Re: rounded edges in Border of StiText

Posted: Tue Mar 14, 2017 7:29 pm
by Alex K.
Hello,

Please check the following code:

Code: Select all

double widthTitle = Text1.Render().GetActualSize().Width;
double beginTitle = (Page1.Width - widthTitle) / 2.0; 
RoundedRectanglePrimitive1.Left = beginTitle;
RoundedRectanglePrimitive1.Width = widthTitle;
Text1.Left = beginTitle;
Thank you.