HOW TO: Dynamically size markup font |
Post Reply |
Author | |
markr
Senior Member Joined: 01 August 2004 Status: Offline Points: 443 |
Post Options
Thanks(0)
Posted: 23 July 2008 at 12:24pm |
Let's say I have a rectangle, the size of which has been computed at runtime. Now, I want to use XTP / XAML to draw a string into that rectangle using the largest font size that will fit.
Does anyone have any suggestions for computing the maximum font size as efficiently as possible? My first thought was to use XTPMarkupMeasureElement to measure an CXTPMarkupUIElement object in a loop, increasing the XAML FontSize attribute until it no longer fits. But this strikes me as being fairly inefficient. I suppose this could be further improved through use of a binary search technique (e.g. to reduce the number of test cases). Anyone know a better way? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
I also see only this way.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |