Free Image Size component

The XHTML WYSIWYG Editor For Desktop & Web Applications

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

  1. Move the dll to a directory like: C:\Program Files\XStandard\Bin\.
  2. Open a command prompt and cd to the directory where the dll is located.
  3. Type regsvr32 XImage.dll
  4. 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.

Context menu for the command prompt showing the option to run as administrator.

Uninstall Instructions

  1. Open a command prompt and cd to the directory where the dll is located.
  2. 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

  1. <%
  2. Dim objImage
  3. Set objImage = Server.CreateObject("XStandard.Image")
  4. objImage.Load "C:\Temp\tennis.jpg"
  5. Response.Write "<div>" & "Width: " & objImage.Width & " (px)</div>"
  6. Response.Write "<div>" & "Height: " & objImage.Height & " (px)</div>"
  7. Response.Write "<div>" & "Size: " & objImage.Size & " (bytes)</div>"
  8. Set objImage = Nothing
  9. %>