Assigns a file to the graphic object.

 

   
Syntax
 
     

[VBScript]
Graphic.SetFile inFile

 

   
Params
 
     
Name   Type   Description
inFile String The path to the graphic file.

 

   
Notes
 
     

Use this method to set the path to a file. This will extract the image data from the contents of the file and infer the type of the image from the file name or contents. If the file does not exist the file type will be inferred but because no data is available it will not be drawable.

 

   
See Also
 
     

Graphic SetData method.

 

   
Example
 
     

[VBScript]
Set gr = Server.CreateObject("ImageGlue7.Graphic")
gr.SetFile Server.MapPath("layers.psd")
Response.Write("<b>Graphic File</b><br>")
Response.Write("Drawable = " & gr.Drawable & "<br>")
Response.Write("Format = " & gr.Format & "<br>")
Response.Write("Number of images = " & gr.Count & "<br>")
For Each img In gr
  Response.Write("<b>Image</b><br>")
  Response.Write("Rect = " & img.Rectangle & "<br>")
  Response.Write("Depth = " & img.Depth & "<br>")
  Response.Write("Resolution = " & img.Resolution & "<br>")
Next

The code scans through each of the layers on a Photoshop document writing out the image details to the page. The input file and output html are shown below.

layers.psd

Graphic File
Drawable = True
Format = Planar RGB
Number of images = 4
Image
Rect = 0,0,200,200
Depth = millions
Resolution = 72
Image
Rect = 0,0,200,200
Depth = millions
Resolution = 72
Image
Rect = 38,92,184,155
Depth = millions
Resolution = 72
Image
Rect = 79,24,180,112
Depth = millions
Resolution = 72