rounded edges in Border of StiText

Stimulsoft Reports.WPF discussion
Post Reply
Prandl33
Posts: 40
Joined: Wed Nov 16, 2016 4:24 pm

rounded edges in Border of StiText

Post by Prandl33 »

Hello,
how I get rounded edges for the Border of a StiText-Objekt?
Thank you
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: rounded edges in Border of StiText

Post by Alex K. »

Hello,

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

Thank you.
Attachments
Capture.PNG
Capture.PNG (15.47 KiB) Viewed 3281 times
Prandl33
Posts: 40
Joined: Wed Nov 16, 2016 4:24 pm

Re: rounded edges in Border of StiText

Post 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 3277 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.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: rounded edges in Border of StiText

Post 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.
Attachments
Capture.PNG
Capture.PNG (38.26 KiB) Viewed 3262 times
Post Reply