PixelsToPoint ?

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,934
Office Version
  1. 2016
Platform
  1. Windows
Hi,

As you know there is an Excel method that converts Points to Pixels like in :

ActiveWindow.PointsToScreenPixelsX

I there a method that would convert Pixels to Points ? Or maybe there is another way to get the conversion outside the Excel object model?

I really need this before I can go any further with my project.

Regards.
 

Some videos you may like

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
Hi Jaafar,

You can convert screen pixels to points by using PointsToScreenPixelsX to give you the conversion like this:

PointsX = ScreenPixelsX / ActiveWindow.PointsToScreenPixelsX(1)

Damon
 

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,934
Office Version
  1. 2016
Platform
  1. Windows
Damon Ostrander said:
Hi Jaafar,

You can convert screen pixels to points by using PointsToScreenPixelsX to give you the conversion like this:

PointsX = ScreenPixelsX / ActiveWindow.PointsToScreenPixelsX(1)

Damon

Thanks Damon,

What value does ScreenPixelsX return in the above expression ?

Regards.
 

Damon Ostrander

MrExcel MVP
Joined
Feb 17, 2002
Messages
4,239
Hi again Jaafar,

It should return the number of screen pixels corresponding to one point.

Damon
 

Watch MrExcel Video

Forum statistics

Threads
1,108,948
Messages
5,525,807
Members
409,663
Latest member
littleriver

This Week's Hot Topics

Top