Previous Next blank.gif blank.gif

Class Image - Inlined Image


SYNOPSIS

import HTMLgen
class Image(AbstractTagSingle)
  def __init__(self, *args, **kw)
  string __module__ = 'HTMLgen'
  def __str__(self)
  dictionary attr_dict = {'id': '', 'border': '', ' ...
  string attr_template = '%(src)s%(height)s%(width) ...
  tuple attrs = ('src', 'height', 'width', ...
  def calc_rel_path(self, from_dir=None)
  def process_arg(self, arg)
  string tagname = 'IMG'

  # Methods inherited by Image from AbstractTagSingle
  def __setattr__(self, name, value)
alias IMG = Image

DESCRIPTION

The filename argument is a filename, or URL of a graphic image, or a triple of ( filename, width, height ) where dimensions are in pixels. Where the filename is found to be a valid pathname to an existing graphic file that file will be read to determine its width and height properties. GIF, JPEG, and PNG files are understood.

def __setattr__(self, name, value)

Intercept attribute assignments.

If the attribute is a legal HTML tag attribute add it to the dict used for substitution in __str__, otherwise just set it as an instance attribute.

def calc_rel_path(self, from_dir=None)

Calculate the relative path from from_dir to the absolute location of the image file.

Sets self.prefix.

Keyword Arguments

width
(int) Width in pixels
height
(int) Height in pixels
border
(int) Border width in pixels
align
(string) 'top'|'middle'|'bottom'|'right'|'left'
alt
(string) Text to substitute for the image in nonGUI browsers
usemap
Imagemap name or Map object
ismap
Flag (1|0) indicating if a server side imagemap is available.
absolute
Absolute path to the directory containing the image
prefix
Relative path or URL to directory containing the image
hspace
Number of pixels to be added to the left and right of the image.
vspace
Number of pixels to be added to the top and bottom of the image.
name
A name for this image to be used by JavaScript
Class
A CSS class this tag belongs to.
style
A CSS inline style specification.

SEE ALSO

HTMLgen

AbstractTagSingle


Previous Next blank.gif blank.gif
Buzz.gif

Copyright © Robin Friedrich
All Rights Reserved
Comments to author: friedrich@pythonpros.com
Generated: Tue Apr 20, 1999