Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / January 2006

Tip: Looking for answers? Try searching our database.

Limit the number of characters given a "Box" size

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 31 Jan 2006 07:31 GMT
Hi, I am trying to work out a way where I can accurately predict the number
of character which will "fit" into a box size.

Say I have a virtual area of 500px by 200px I need to find out how many size
8 font characters will fit into this box.

I know that I could take the average and say that the average size 8 font is
12 pixels x 12 pixels so techinically, I should be able to fit in 694
characters into the area.

(500 x 200)/144 = 694 characters

However, what given that some characters can be bigger than others (W is
wider than the letter l for example) this kills my averages I cannot get any
real accuracy and it is causing major headaches.

Any ideas more than welcome!
Thanks
M
Peter Rilling - 31 Jan 2006 08:08 GMT
Well, in general you can try the MeasureString method.  But I am not sure
how this will be beneficial in a web environment since the server has no
control over the appearance on the browser.  Any measurements will be
calculated on the server.

> Hi, I am trying to work out a way where I can accurately predict the
> number of character which will "fit" into a box size.
[quoted text clipped - 15 lines]
> Thanks
> M
Mark - 31 Jan 2006 18:36 GMT
Thanks Peter, I will look into this option
Cheers
Mark
> Well, in general you can try the MeasureString method.  But I am not sure
> how this will be beneficial in a web environment since the server has no
[quoted text clipped - 20 lines]
>> Thanks
>> M

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.