Image Size Component
Overview
The Image Size component calculates the dimensions of an image. Supported formats are JPEG, GIF, PNGand BMP. This component can be used in environments that support COM such as Active Server Pages, Windows Scripting Host, Visual Basic, etc.
- License
- Freeware
- Type
- ActiveX DLL for 32 bit OS
- Version
- 1.0
- File Name
- XImage.dll
- Download Package
- x-image.zip
Download
Download Image Size Component
Installation Instructions
- Move the dll to a directory like: C:\Program Files\XStandard\Bin\.
- Open a command prompt and
cd
to the directory where the dll is located. - Type regsvr32 XImage.dll
- Grant "Read & Execute" file permissions on this dll to Everyone.
Note, on Microsoft Vista, the command prompt must be "Run as administrator" as shown in the screen shot below.
Uninstall Instructions
- Open a command prompt and
cd
to the directory where the dll is located. - Type regsvr32 -u XImage.dll
API Reference: ProgID: XStandard.Image
Property Format As ImageFormat
(read-only)
Image format
Property Height As Long
(read-only)
Height of an image in pixels
Function Load(sFileName As String) As Boolean
Load an image file
Property LogFile As String
Path to log file
Property Size As Long
(read-only)
Size of the image in bytes
Property Width As Long
(read-only)
Width of an image in pixels
API Reference: ProgID: Enum: ImageFormat
Const Const btBMP = 4
BMP format
Const btGIF = 1
GIF format
Const Const btJPEG = 2
JPEG format
Const Const btPNG = 3
PNG format
Const Const btUNKNOWN = 0
Unknown format
Examples
The examples below are for Active Server Pages. For Windows Scripting Host or Visual Basic, replace Server.CreateObject
with CreateObject
and replace Resonse.Write
with MsgBox
.
Get the dimensions of an image
<%
Dim objImage
Set objImage = Server.CreateObject("XStandard.Image")
objImage.Load "C:\Temp\tennis.jpg"
Response.Write "<div>" & "Width: " & objImage.Width & " (px)</div>"
Response.Write "<div>" & "Height: " & objImage.Height & " (px)</div>"
Response.Write "<div>" & "Size: " & objImage.Size & " (bytes)</div>"
Set objImage = Nothing
%>