os::ImageView Class Reference
[The Syllable Graphical User Interface API]

View class for Image objects. More...

Inheritance diagram for os::ImageView:

os::View os::Handler List of all members.

Public Types

enum  ImageMode {
  FIXED_SIZE = 0x10000000,
  NORMAL = 0x00000000 | FIXED_SIZE,
  TILE = 0x00000001,
  STRETCH = 0x00000002,
  ALPHA = 0x00001000,
  DEFAULT = NORMAL | ALPHA
}

Public Member Functions

 ImageView (Rect cFrame, const String &cName, Image *pzImage, ImageMode eMode=DEFAULT, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND|WID_FULL_UPDATE_ON_RESIZE)
 Constructor.
 ~ImageView ()
void Paint (const Rect &cUpdateRect)
 View callback, Renders the Image.
Point GetPreferredSize (bool bLargest) const
 Returns size for automatic layout.
void SetImage (Image *pcImage)
ImageGetImage (void) const
void Refresh ()
 Refresh image.

Classes

class  Private

Detailed Description

Description:
The ImageView class allows you to display Image objects of any kind on screen. Simply attach an Image object to the ImageView, and attach the ImageView to a Window.
Note:
ImageView does not delete the delete the image, so you must delete it yourself. This also means that it is possible to display the same Image in two or more ImageViews, but care should be taken not to share the same image between multiple threads.
See also:
os::Image, os::BitmapImage, os::VectorImage, os::View
Author:
Henrik Isaksson ([email protected])


Member Enumeration Documentation

enum os::ImageView::ImageMode

Enumerator:
FIXED_SIZE 
NORMAL 
TILE 
STRETCH 
ALPHA 
DEFAULT 


Constructor & Destructor Documentation

ImageView::ImageView ( Rect  cFrame,
const String cName,
Image pcImage,
ImageMode  eMode = DEFAULT,
uint32  nResizeMask = CF_FOLLOW_LEFT|CF_FOLLOW_TOP,
uint32  nFlags = WID_WILL_DRAW|WID_CLEAR_BACKGROUND|WID_FULL_UPDATE_ON_RESIZE 
)

Description:
Parameters:
cFrame The frame rectangle in the parents coordinate system.
pzName The logical name of the view. This parameter is newer rendered anywhere, but is passed to the Handler::Handler() constructor to identify the view.
pcImage The Image object to display.
eMode Specifies how to render the Image (TILE, STRETCH, NORMAL).
nResizeMask Flags defining how the views frame rectangle is affected if the parent view is resized.
nFlags Various flags to control the views behavour.
See also:
os::Image, os::View
Author:
Henrik Isaksson ([email protected])

ImageView::~ImageView (  ) 


Member Function Documentation

void ImageView::Paint ( const Rect cUpdateRect  )  [virtual]

Description:
This method is called by the OS when the ImageView needs to refresh it's imagery.
Parameters:
cUpdateRect The part of the ImageView that needs refreshing.
Todo:
STRETCH is not implemented.
See also:
os::Image, os::View
Author:
Henrik Isaksson ([email protected])

Reimplemented from os::View.

Point ImageView::GetPreferredSize ( bool  bLargest  )  const [virtual]

Description:
This method is used by LayoutNode classes to calculate the size of the object. You can override this method to get a fixed-size ImageView.
Parameters:
bLargest Tells whether the smallest (normal) size is requested, or the largest possible size.
Return values:
Returns the the Image size if bLargest is false, otherwise it returns Point( COORD_MAX, COORD_MAX ).
See also:
os::View, os::LayoutNode, os::LayoutView
Author:
Henrik Isaksson ([email protected])

Reimplemented from os::View.

void ImageView::SetImage ( Image pcImage  ) 

Image * ImageView::GetImage ( void   )  const

void ImageView::Refresh (  ) 

Description:
This method is intended for use with double buffered animation. Call Refresh() after changing the attached image. The difference between this method and Invalidate(), is that this method will not clear the background.
Note:
Refresh() does not work with transparent bitmaps.
See also:
os::Image, os::View
Author:
Henrik Isaksson ([email protected])


Generated on Sat May 9 22:51:32 2009 for Syllable higlevel API by  doxygen 1.5.1