LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX Spreadsheet: Points to Pixels

Hi,
 
Can anyone tell me how to convert points to pixels?  I know that a point is 1/72 of an inch and I can get my screen resolution but I can't figure out the dpi of my screen.  I would think this would be able to be obtained using properties of the spreadsheet but I can't figure it out.
 
I'm using a Microsoft Office Spreadsheet 11.0 in an ActiveX container.
 
I want to size the ActiveX container so that the ViewableRange of the spreadsheet fits in it neatly.  I can do everything except figure out the dpi conversion.
 
I'm using LabVIEW 8.0.1.
 
My example has everything except for the correct conversion.  Don't forget to manually resize the ActiveX control before you run it so you can see the new results.
 
Thanks,
Albert
 
0 Kudos
Message 1 of 10
(3,727 Views)

Right click on the object container on your front panel the select Property Browser then set AutoFit=True.

Edit: Its also available as an property of ISpreadsheet.

David

Message Edited by David Crawford on 12-07-2006 09:37 AM

Message 2 of 10
(3,713 Views)

Hi,

AutoFit doesn't work after manually resizing the container.  Do you know how to enable it again after resizing the container?

Thanks,
Albert

0 Kudos
Message 3 of 10
(3,700 Views)

Your right it doesn't when you toggle the property in design mode. Just use the property node to Autofit when you run your code.

David

0 Kudos
Message 4 of 10
(3,695 Views)

Hi,

That also doesn't work.

Thanks,
Albert

0 Kudos
Message 5 of 10
(3,693 Views)
Hi Albert,

If you are simply looking for the DPI setting of your display, this value could be found by opening 'Display' from control panel: Settings -> Advanced. Please let me know if this is what you are looking for. Thanks!

Best regards,

Steven C
Message 6 of 10
(3,638 Views)

Hi,

I have my program getting the monitor settings but those values are dots on the screen and they aren't related to "points" or inches.  Or are they and I'm missing something?

Thanks,
Albert

0 Kudos
Message 7 of 10
(3,634 Views)
Hi Albert,

When you say dots on the screen, it sounds like you are referring to something like 1280x1024 for example. DPI (Dots Per Inch) is the standard used to measure screen and printer resolution. It is expressed as the number of dots that a device can display or print per linear inch. Please let me know if this is in fact what you are looking for. Thanks!

Best regards,

Steven
Message 8 of 10
(3,614 Views)
Hi,
 
Sorry, I (lazily) misread your message.  That DPI setting is exactly what I needed and I'm now reading it from the registry from AppliedDPI which is in HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics.
 
Thanks,
Albert
0 Kudos
Message 9 of 10
(3,601 Views)
Excellent! I am glad it helped.

Good luck with your application!

Steven

Message Edited by Steven C on 12-12-2006 11:41 AM

0 Kudos
Message 10 of 10
(3,582 Views)