This is a migrated thread and some comments may be shown as answers.

RadGeometryButton: size of geometry

4 Answers 263 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Hans
Top achievements
Rank 2
Hans asked on 22 Sep 2015, 11:08 PM

How can I control the size of the geometry in the RadGeometryButton. I'm using Syncfusion Metro Studio 3 for my assets and the geometries do not fit inside the circle. See attached screenshots for clarification.

4 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 23 Sep 2015, 08:03 AM
Hello Hans,

Can you please send us one of the geometries that does not fit in the RadGeometryButton? This way we will be able to provide you with the most adequate advice. Generally there are several specific things with the paths:

- the value of their Stretch property,
- the value of their Data property, because there are default size in it,
- and also whether their Width and Height are specified.

Regards,
Sia
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Hans
Top achievements
Rank 2
answered on 23 Sep 2015, 09:52 AM

Aha, so ​the size depends on what is defined in the geometry data itself. I assumed these were simple vectors that stretched relative to their container. But it makes sense now.

I guess what I need to do now is to find a application that allows me to easily modify these geometries to add a specific height and width. Suggestions are welcome. :-)

Thanks a lot Sia!

0
Hans
Top achievements
Rank 2
answered on 23 Sep 2015, 10:36 AM

Hmm, I had a look in blend and I can set the height and width of a Path, but not of the geometry data itself. Since the RadGeometryButton only accept a geometry and not a path I still can't control the size like that. Here's an example of a geometry that I'm trying to use:

 M26.9065,24.528999L29.782799,32.861206 36.5172,27.165766 33.944199,35.604473 42.7411,34.952057 35.7033,40.267189 43.202,44.908405 34.385601,45.07341 37.720299,53.234814 30.494999,48.185787 28.3934,56.75 25.5119,48.417294 18.780201,54.110836 21.3505,45.676025 12.5549,46.327843 19.5914,41.01181 12.094001,36.369095 20.911699,36.20509 17.5758,28.042786 24.8036,33.095112z M22.1576,5.39746L21.7943,17.167999C21.7943,17.167999,21.3242,24.952101,12.7474,24.0117L5.3958702,23.812 5.3958702,57.253899C5.3958702,57.999001,6.0026202,58.603001,6.7474403,58.603001L44.5313,58.603001C45.273399,58.603001,45.880199,57.999001,45.880199,57.253899L45.880199,6.7460899C45.880199,6.0039101,45.273399,5.39746,44.5313,5.39746z M21.804701,0L44.5313,0C48.257801,0,51.279999,3.02246,51.279999,6.7460899L51.279999,57.253899C51.279999,60.98,48.257801,64,44.5313,64L6.7474403,64C3.02087,64,0,60.98,0,57.253899L0,23.0054 2.6718798,20.186501 2.6744995,20.1094 16.677099,5.39746 16.6381,5.39746 12.8945,9.3466797 16.816401,5.1914101 16.8724,5.1914101 16.996099,5.0615196 17.007799,5.0615196z

Kind regards,
Hans

0
Sia
Telerik team
answered on 25 Sep 2015, 03:35 PM
Hello,

You can find my comments below:

I guess what I need to do now is to find a application that allows me to easily modify these geometries to add a specific height and width. Suggestions are welcome. :-)

Yes, all geometries have default size which can be seen in Blend if you do not set Width and Height and set the Stretch property to None. For example you can open the attached WpfApplication5 project in Blend and see that the first path which is yours has auto generated width which is 51,2799... and auto generated height which is 64. I have tried to simplify it for you, please check the second path which size is almost the same, but its data is much more shorter. This will make your code cleaner. Unfortunately I cannot give you advice about a tool that can modify the default size of a path easily. There are tools that can just make the points with one or two digits after the comma, but the rest we do by hand. You can edit a path with the Direct selection tool in Blend and remove unnecessary points very easily. The best possible solution of your problem is a designer who will draw it in Blend by scratch. Please have in mind that if a geometry is drawn in another program and after that exported to Blend, usually the data will be very long - the points will be with many digits after the comma and there will be unnecessary points in it.

Aha, so ​the size depends on what is defined in the geometry data itself. I assumed these were simple vectors that stretched relative to their container.

It is OK to use a path with large default size and just set its Stretch property to Fill and apply the needed Width and Height. You can check the third path in the attached WpfApplication5 project. However with the current implementation of the RadGeometryButton it is not a trivial task to change the value of the path's Stretch property. That is why you will need a custom style for it and an implicit style that will target the path inside it. You can check the attached WpfApplication9 project for reference.

Another possible solution is to use RadPathButton instead of RadGeometryButton, because there you can easily manipulate the size of the path inside it. Just have in mind that we still do not provide similar RadPathToggleButton, RadPathDropDownButton and RadPathSplitButton. That is why I am not sure whether this will help you. Again you can see how to use RadPathButton in the attached WpfApplication9 project.


Regards,
Sia
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Buttons
Asked by
Hans
Top achievements
Rank 2
Answers by
Sia
Telerik team
Hans
Top achievements
Rank 2
Share this question
or