Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to map pixels to millimeters ?

0 views
Skip to first unread message

Frederic Claux

unread,
Aug 2, 2001, 9:56:46 AM8/2/01
to
Hi,

Considered the following :

<SPAN ID="mySpan"
STYLE="position: absolute; left: 0px; top: 0px; width: 200mm; height:
150mm">
...
</SPAN>

I'm looking for a way to convert my millimeters into pixels so that I get
*exactly* the same layout for my span, or any other kind of object. It would
be done by function like the following one :

SetWidthHeightAsPixels(mySpan);

function SetWidthHeightAsPixels(id)
{
...
}

The trouble is that using GDI functions with an ActiveX control, it seems
that I do not get exactly the same mapping as the ones computed by Internet
Explorer (5.5 in my case).

Is there a way to achieve that through DHTML ?

Thanks for any clue.

--
Frederic Claux

Thor Larholm

unread,
Aug 2, 2001, 10:20:15 AM8/2/01
to
"Frederic Claux" <nospam_f.claux@nospam_techbase.fr> wrote in message
news:uGWXTt1GBHA.380@tkmsftngp05...

> Considered the following :
> <SPAN ID="mySpan"
> STYLE="position: absolute; left: 0px; top: 0px; width: 200mm; height:
> 150mm">
> </SPAN>
>
> I'm looking for a way to convert my millimeters into pixels

Just read mySpan.style.pixelWidth or mySpan.offsetWidth, they will both return
in pixel measurement.

--
Thor Larholm
<URL: http://www.jibbering.com/faq/> FAQ for comp.lang.javascript


Frederic Claux

unread,
Aug 2, 2001, 10:34:29 AM8/2/01
to
I can't believe I missed it, thanks a lot Thor !

--
Frederic Claux

"Thor Larholm" <th...@jubii.dk> a écrit dans le message news:
ehdeD41GBHA.1280@tkmsftngp02...

0 new messages