Answer by PTwr for WP8/XAML - Measure string length in pixels
Solution working on WP8 device (tested on HTC 8S and Lumia 920) public int TextWidth(string text) { TextBlock t = new TextBlock(); t.Text = text; //Height and Width are depending on font settings...
View ArticleAnswer by crea7or for WP8/XAML - Measure string length in pixels
Try this:t.Measure( new Size( 1000, 1000 );t.Arrange( new Rect( 0, 0, 1000, 1000 );t.UpdateLayout();
View ArticleWP8/XAML - Measure string length in pixels
Pixel-length measuring code, like this one:public int TextWidth(string text) { TextBlock t = new TextBlock(); t.Text = text; t.Measure(new Size(1000, 1000)); return (int)t.DesiredSize.Width; }Is not...
View Article
More Pages to Explore .....