os_input_image


An input image within a form.

An os_input_image displays an image and accepts a single pixel selection from the image within an os_form . In this way, an os_input_image is like an os_image mapped through a CGI program. However, when selected, an os_input_image behaves like an os_input_submit button.

The source URL of the displayed image is specified in a constructor and can be modified through the source() member function. The URL typically references an image in the GIF or JPEG format. The alignment of the image with respect to surrounding text can be specified through either a constructor or the align() member function.

An os_input_image is identified within an os_form by a name. The name is specified in a constructor and can be modified through the name() member function. When the form is transmitted, two name/value pairs specifying the coordinates of the selected image pixel are transmitted for the os_input_image . The pair names are constructed by appending . x and . y to the os_input_image name. The pair values are the x and y coordinates of the selected image pixel, measured in pixels from the upper left corner of the image.

An os_form can contain multiple os_input_image elements. However, only the coordinate name/value pairs from the selected os_input_image are transmitted when the os_form is submitted.

Declaration

#include <ospace/web/inimage.h>
class os_input_image : public os_element

Enums

enum os_input_image::alignment
  {
  top,     // Aligns the top of image with the line's text.
  middle,  // Aligns the middle of image with the line's text.
  bottom,  // Aligns the bottom of the image with the line's text.
  };

Interface

Constructor
os_input_image( const string& name , const string& source )
Constructs an input image with name name and image URL source .
Constructor
os_input_image( const string& name , const string& source , alignment align )
Constructs an input image with name name , image URL source , and alignment align with respect to surrounding text.
align
os_input_image& align( alignment align )
Sets the alignment with respect to surrounding text to align , and returns a reference to the input image.
align
int align() const
Returns the alignment with respect to surrounding text, or os_element::use_default if not set.
clone
/* virtual */ os_element* clone() const
Returns a base class pointer to a heap-based deep copy of the input image.
name
string name() const
Returns the name.
name
os_input_image& name( const string& name )
Sets the name to name and returns a reference to the input image.
source
string source() const
Returns the image URL.
source
os_input_image& source( const string& source )
Sets the image URL to source and returns a reference to the input image.

Copyright©1994-2026 Recursion Software LLC
All Rights Reserved