Article View: borland.public.jbuilder.java.swing
Article #11562Re: How : Covert VB control locations to Java
From: Chris Hill
Date: Wed, 05 May 1999 00:00
Date: Wed, 05 May 1999 00:00
68 lines
2984 bytes
2984 bytes
Thanks for the extra fraction! In my defense, my fractions imply 1/72 of an inch. :) Windows uses "simulated inches" on the display. (I don't think this has changed even in more recent versions of Windows that know which monitor is being used) There are certain number of dots per "inch", but this number does not reflect on the size of data on the screen. The fake screen DPI is usually 96 or 120. This Windows system is used in VB. You can convert from pixels to inches using Toolkit.getScreenResolution at runtime (or write a custom layout manager to make it easier). The accuracy of this technique of course depends on the Toolkit implementation. But it is possible to approximate the VB twips solution (or any other "physical" unit like cm). On Wed, 05 May 1999 08:15:40 -0700, Richard Wilkman <rwilkman@inprise.com> wrote: >Chris: > >TWIPS is correct. It brought forth a whole slew of painful memories. >Now I have to go see my psychiatrist. I'll probably have to go back >on that medication, too. Gee, thanks Chris! ;-) > >Still can't get from there to pixels, though. Just to add another >fraction there, one point is 1/72 of an inch. Fr. Gutenberg would be >proud. > >-Rich > >Chris Hill wrote: >> >> I think VB uses TWIPS (1/1440 of an inch [1/20 of a point]) >> >> On Wed, 5 May 1999 08:41:15 +1000, "Sohan Mendis" <sohan@maxtrak.com> >> wrote: >> >> >Well yes . I think so . Because if u look at the height and width of a say >> >text box. Its pretty larger. If u replace the values in Java , its pretty >> >big. >> > >> >Sohan >> > >> >Richard Wilkman <rwilkman@inprise.com> wrote in message >> >news:372F0C0B.B72F008@inprise.com... >> >> Sohan: >> >> >> >> Pretty sure that VB uses pixels, too, but it's been a few years since >> >> I cracked my VB install open. If you truly need to work with cm, >> >> however, I can't think of a way to easily do it in Java. It's not >> >> like there are so many pixels to the centimeter. Are you sure you >> >> are't seeing things measured in "ems" (pronounced like the letter >> >> 'm')? >> >> >> >> -Rich >> >> >> >> Sohan Mendis wrote: >> >> > >> >> > I want to convert VB control locations , which I think in centemeters, >> >to >> >> > pixels which are used in Java. How can I do this conversion ? >> >> > >> >> > Sohan Chris Hill Chris244@aol.com
Technical Details
Message-ID:
<37306d20.77613332@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7glkat$62i1@forums.borland.com> <372F0C0B.B72F008@inprise.com> <7gnsjm$7t717@forums.borland.com> <372fa0a6.25267433@forums.borland.com> <3730609C.8569F23B@inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,62965e664969eb04 X-Google-Attributes: gid111d45,public From: Chris244@aol.com (Chris Hill) Subject: Re: How : Covert VB control locations to Java Date: 1999/05/05 Message-ID: <37306d20.77613332@forums.borland.com> X-Deja-AN: 474374587 References: <7glkat$62i1@forums.borland.com> <372F0C0B.B72F008@inprise.com> <7gnsjm$7t717@forums.borland.com> <372fa0a6.25267433@forums.borland.com> <3730609C.8569F23B@inprise.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing