Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Introduction

A WOImage displays an image in the HTML. It corresponds to the HTML element <IMG SRC="URL">.

Usage

Code Block
WOImage { 
  src=aURL; 
  | value=imageData; 
  | filename= imageFileName; [framework = frameworkBaseName | "app" ;] 
  | data=dataObject; 
  mimeType=typeString; 
  [width=anInt;] 
  [height=anInt;] 
  [key=cacheKey;]... 
}

Bindings

src

URL containing the image data. Use this attribute for complete URLs; for relative URLs use filename instead.

value

Image data in the form of a WOElement object. This data can come from a database, a file, or memory.

filename

Path to the image relative to the WebServerResources directory.

framework

Framework that contains the image file. This attribute is only necessary if the image file is in a different location from the component. That is, if the component and the image file are both in the application or if the component and the image file are both in the same framework, this attribute isn't necessary. If the image file is in a framework and the component is in an application, specify the framework's name here (minus the .framework extension). If the image file should be in the application but the component is in a framework, specify the "app" keyword in place of the framework name.

data

Specifies an image resource in the form of an NSData; this data can come from a database, a file, or memory. If you specify resource data, you must specify a MIME type.

mimeType

A string designating a MIME resource type, such as "image/gif", to be put in the content-type header; this type tells the client what to do with data. If you provide data but no MIME type, WebObjects throws an exception.

width

The width of the image. If you don't specify a width, WebObjects loads and analyzes the image resource to determine its dimensions.

height

The height of the image. If you don't specify a height, WebObjects loads and analyzes the image resource to determine its dimensions.

key

A string that the application uses as a key for caching the data specified in data. If you do not provide a key, the data object must be fetched each time it is needed. For further information, see the reference documentation for the WOResourceManager class, particularly that for the flushDataCache method.

Examples

Java methods

WOD-style

Code Block

Inline bindings (WOOGNL)

Code Block

Related documents