Photo Gallery
Member List
Search
Calendars
FAQ
Ticket List
Log Out
Forums
Register
Login
My Profile
Inbox
Address Book
My Subscription
My Forums
Get Resolution (DPI) of an Image
Logged in as: Guest
arrSession:exec spGetSession 2,16,26527
Active Users: There are
0
members and
0
guests.
Users viewing this topic: none
Printable Version
All Forums
>>
[Scripting]
>>
Post a VBScript
>> Get Resolution (DPI) of an Image
Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page:
[1]
Login
Message
<< Older Topic
Newer Topic >>
Get Resolution (DPI) of an Image -
9/28/2005 9:32:12 PM
TNO
Posts: 1064
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status:
offline
I'm sure some of you have seen this but here is the final product for posterity:
Put this in a vbs/hta and run it. A window won't be displayed and it will alert the result.
Function GetInfo(src) Dim objExplorer,objDocument,WshShell Set objExplorer = CreateObject ("InternetExplorer.Application") set WshShell = WScript.CreateObject("WScript.Shell") objExplorer.Navigate "about:blank" objExplorer.Visible = 0 'Defines HTML code for window Set objDocument = objExplorer.Document objDocument.Open objDocument.Writeln "<html><head></head><body>" objDocument.Writeln "<img name='ME' src='"&src&"'><br>" objDocument.Writeln "<script>alert('Screen X DPI: '+screen.deviceXDPI+'\nScreen Y DPI: '+screen.deviceYDPI+'\nScreen Width '+screen.width+'\nScreen Height: '+screen.height+'\nScreen Width: '+Math.round(screen.width/screen.deviceXDPI)+' inches\nScreen Height: '+Math.round(screen.height/screen.deviceYDPI)+' inches\nImage width: '+document.all.ME.width+'\nImage Height: '+document.all.ME.height+'\nWidth on screen: '+Math.round(document.all.ME.width/screen.deviceXDPI)+' inches\nHeight on screen: '+Math.round(document.all.ME.height/screen.deviceYDPI)+' inches\nTotal pixels: '+document.all.ME.height*document.all.ME.width+'\nDPI: '+document.all.ME.width/(document.all.ME.width/screen.deviceXDPI))</script>" objDocument.Writeln "</body></html>" objExplorer.Quit End Function
GetInfo("
../dpi/test.jpg
")
< Message edited by
TNO
--
9/28/2005 9:33:27 PM
>
_____________________________
To iterate is human, to recurse divine.
-- L. Peter Deutsch
Post #: 1
If you found our site useful please link to us
<a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>
.
All Forums
>>
[Scripting]
>>
Post a VBScript
>> Get Resolution (DPI) of an Image
Page:
[1]
Jump to:
Select a Forum
All Forums
----------------------
[Welcome]
- - Forum Rules
- - Test Posting Messages
- - New Member Area/Introduction
[Scripting]
- - WSH & Client Side VBScript
- - WSH & Client Side VBScript Tutorial
- - Post a VBScript
- - Windows PowerShell
- - ASP
- - ASP.NET
- - Windows Script Components
[General Forum]
- - Other Programming/Scripting Languages
- - Suggestions & Feedback
- - Off-Topic Lounge
New Messages
No New Messages
Hot Topic w/ New Messages
Hot Topic w/o New Messages
Locked w/ New Messages
Locked w/o New Messages
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
Forum Software ©
ASPPlayground.NET
Advanced Edition
2.5.5 ANSI