Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Convert Unit types.

Reply
Thread Tools

Convert Unit types.

 
 
Ken Varn
Guest
Posts: n/a
 
      10-19-2004
Can someone explain how to convert a Unit type to a meaningful value? There
is a way to convert from a Pixel, Percent, etc.. to a Unit, but I have not
figured out how to convert from a Unit.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------


 
Reply With Quote
 
 
 
 
WALDO
Guest
Posts: n/a
 
      10-26-2004
The Unit structure is merely there to convert those unit types into
strings for web controls. There is no math involved in this structure.

If you want to do conversions, you'll have to write your own conversion
functions.

Off the top of my head, I think it's:
72 points/inch (I could be wrong)
96 pixels/inch (I could be wrong)
You can convert percent to pixels and vice-versa if you know the width
in pixels of whatever its contained in. (10% of a 400px container is
40px)



Sometimes the greatest solutions come from the simplest logic.
Being told no is merely the incentive to do it anyway.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
WALDO
Guest
Posts: n/a
 
      10-26-2004
There are also the Type and Value Properties on the Unit Structure. For
Example:

Dim u As Unit = Unit.Parse("17px")
'u.Value = 17
'u.Type = Pixel



Sometimes the greatest solutions come from the simplest logic.
Being told no is merely the incentive to do it anyway.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Friendly Easy To Install Unit For Voip Like Vonage Unit SuggestionsPlease? Heidy UK VOIP 1 06-22-2007 09:53 AM
unit--, a unit test framework for C++ VvanN C++ 5 04-28-2006 10:01 AM
connect a source unit with an S-Video connection to a receiving unit that has an RCA composite video connection ? worth it ? OCZ Guy DVD Video 6 08-01-2004 05:44 PM
Connect a source unit DVD with an S-Video connection to a receiving unit TV that has an RCA composite video connection Worth it. OCZ Guy Computer Information 0 07-31-2004 12:29 PM



Advertisments