
Quote from Feli on April 26, 2019, 12:51 pmHello, NeoWiners!
How can I do, for example in vbs to recover width and height of an image file?
I can not find anything on the Web...
Thanks in advance.
Hello, NeoWiners!
How can I do, for example in vbs to recover width and height of an image file?
I can not find anything on the Web...
Thanks in advance.



Quote from HPW on April 26, 2019, 6:15 pmHello,
I you would consider to use a plugin you may have a look at hpwImage:
https://visualneo.com/shop/hpws-freeware
Command:
hpwImageSize "[PubDir][TextEntry13]" "[XSize]" "[YSize]"
Regards
Hans-Peter
Hello,
I you would consider to use a plugin you may have a look at hpwImage:
Command:
hpwImageSize "[PubDir][TextEntry13]" "[XSize]" "[YSize]"
Regards
Hans-Peter
Quote from Gaev on April 26, 2019, 6:17 pmFeli:
But that is for the picture object.
I would like for the (Windows) file.Try ...
GetObjectInfo "object name" "ImageWidth" "variable" GetObjectInfo "object name" "ImageHeight" "variable"... if you don't want your user to see this image, just place "object name" in an "off screen location"
If you absolutely need to do it without loading the file, this webpage ...http://computer-programming-forum.com/59-vbscript/75000bd4d75d412d.htm ... has a vbs script to do it ...
Dim ImageArray Dim ThisImage ThisImage = "full or relative path to your image" ImageArray = Dimensions(ThisImage) MsgBox "The image dimensions are width: " & ImageArray(0) &_ " height: " & ImageArray(1),0,ThisImage wscript.quit Function Dimensions(strPicturePath) dim picture 'Documentation for the picture object is hard to find. On Error Resume Next Set Picture = LoadPicture(strPicturePath) If Err <> 0 Then Dimensions = Array(0,0) Else Dimensions = Array(Round(Picture.Width / 26.5),_ Round(Picture.Height / 26.5)) End If End Function... I have not verified that it works.
Feli:
But that is for the picture object.
I would like for the (Windows) file.
Try ...
GetObjectInfo "object name" "ImageWidth" "variable" GetObjectInfo "object name" "ImageHeight" "variable"
... if you don't want your user to see this image, just place "object name" in an "off screen location"
If you absolutely need to do it without loading the file, this webpage ...http://computer-programming-forum.com/59-vbscript/75000bd4d75d412d.htm ... has a vbs script to do it ...
Dim ImageArray Dim ThisImage ThisImage = "full or relative path to your image" ImageArray = Dimensions(ThisImage) MsgBox "The image dimensions are width: " & ImageArray(0) &_ " height: " & ImageArray(1),0,ThisImage wscript.quit Function Dimensions(strPicturePath) dim picture 'Documentation for the picture object is hard to find. On Error Resume Next Set Picture = LoadPicture(strPicturePath) If Err <> 0 Then Dimensions = Array(0,0) Else Dimensions = Array(Round(Picture.Width / 26.5),_ Round(Picture.Height / 26.5)) End If End Function
... I have not verified that it works.

Quote from Feli on April 27, 2019, 11:29 amOh my god !
So much time to look for a small line of script.
Thank you very much you are the best !
Oh my god !
So much time to look for a small line of script.
Thank you very much you are the best !