Public Member Functions

IMaxBitmapViewer Class Reference

Search for all occurrences

Detailed Description

See also:
Class IImageViewer, Class Bitmap, Class CropCallback

Description:
This class is available in release 4.0 and later only.

This class represents an abstract interface class for a default bitmap viewer.

The following functions are available for use but are not part of the class IMaxBitmapViewer.

Note that the minimum size of the floating window is 390 x 325.

#include <iimageviewer.h>

Inheritance diagram for IMaxBitmapViewer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void  SetBitmap (Bitmap *pBitmap)=0
virtual Bitmap GetBitmap () const =0
virtual void  SetCropCB (CropCallback *pCropCallback)=0
virtual CropCallback GetCropCB () const =0
virtual void  SetAutonomous (bool isAutonomous)=0
virtual bool  GetAutonomous () const =0
virtual void  SetCurrentPosition (WindowPosition currentPosition)=0
virtual WindowPosition  GetCurrentPosition () const =0
virtual void  SetShowSaveButton (bool showSaveButton)=0
virtual bool  GetShowSaveButton () const =0
virtual bool  Display (MCHAR *title, WindowPosition position=WPos_Center)=0
virtual bool  Display (MCHAR *title, HWND hParent, int x, int y, int w, int h)=0
virtual bool  UnDisplay ()=0
virtual void  ClearScreen ()=0
virtual POINT  XFormScreenToBitmap (const POINT &pt) const =0
virtual POINT  XFormBitmapToScreen (const POINT &pt) const =0
virtual Rect  XFormScreenToBitmap (const Rect &rect) const =0
virtual Rect  XFormBitmapToScreen (const Rect &rect) const =0
virtual void  ShowToolbar (bool show)=0
virtual void  ToggleToolbar ()=0
virtual void  GetDrawableRect (Rect &drawableRect)=0
virtual void  RefreshWindow (Rect *pRefreshRegion=NULL)=0
virtual BaseInterface GetInterface (Interface_ID id)

Member Function Documentation

virtual void SetBitmap ( Bitmap pBitmap ) [pure virtual]
Remarks:
This method allows you to set the bitmap which should be displayed in the bitmap viewer.

Note: This is for internal use only.
Parameters:
Bitmap* pBitmap

A pointer to the bitmap to display.
virtual Bitmap* GetBitmap ( ) const [pure virtual]
Remarks:
This method returns a pointer to the bitmap that is being displayed by the bitmap viewer.
virtual void SetCropCB ( CropCallback pCropCallback ) [pure virtual]
Remarks:
This method allows you to set the crop callback function which will assist in interactive adjustments of the bitmap cropping rectangle. This method should not be called after the window has been displayed. Preferably the callback should be set before the window is displayed or after the window has been destroyed.
Parameters:
CropCallback* pCropCallback

A pointer to the callback function to set.
virtual CropCallback* GetCropCB ( ) const [pure virtual]
Remarks:
This method returns a pointer to the crop callback function used by the bitmap viewer.
virtual void SetAutonomous ( bool  isAutonomous ) [pure virtual]
Remarks:
This method allows you to set whether the bitmap viewer is autonomous or not. When the bitmap viewer is set in autonomous mode, the viewer will not have a clone button, although the viewer will not display a clone button unless the save button is also displayed. Changes will not take effect until the next time the viewer is displayed using Display().
Parameters:
bool isAutonomous

TRUE to set the viewer to autonomous, otherwise FALSE.
virtual bool GetAutonomous ( ) const [pure virtual]
Remarks:
This method returns TRUE if the viewer is autonomous, otherwise FALSE. When the bitmap viewer is set in autonomous mode, the viewer will not have a clone button, although the viewer will not display a clone button unless the save button is also displayed.
virtual void SetCurrentPosition ( WindowPosition  currentPosition ) [pure virtual]
Remarks:
A call to this method will never impact the current opened window. This function should be used prior to calling Display() in order to specify the position of the next created window.
virtual WindowPosition GetCurrentPosition ( ) const [pure virtual]
Remarks:
This method returns the current position of the bitmap viewer.
virtual void SetShowSaveButton ( bool  showSaveButton ) [pure virtual]
Remarks:
This method allows you to set whether or not the save button should be shown as part of the bitmap viewer window. A change will not take effect until the next time the viewer is opened via Display().
Parameters:
bool showSaveButton

TRUE to show; FALSE to hide.
virtual bool GetShowSaveButton ( ) const [pure virtual]
Remarks:
This method returns TRUE if the save button is shown as part of the bitmap viewer window, otherwise FALSE.
virtual bool Display ( MCHAR *  title,
WindowPosition  position = WPos_Center 
) [pure virtual]
Remarks:
This method will display the bitmap image viewer. Note that the Show() and Hide() methods have no effect until the window is initialized by a call to Display(). This method should not be called when the window is already open and this method can't be used to create a docked viewer.

You should also not call this twice on this interface. The second time the function is called, the viewer will loose all references to the previoulsy opened window. To switch images using the same bitmap viewer, a call to "UnDisplay" should be made to close the previous window before calling this method again.

Parameters:
MCHAR *title

The title of the window to set.

WindowPosition position = WPos_Center

The window position you wish to set, which is one of the following enum values; WPos_NULL, WPos_UpperLeft, WPos_LowerLeft, WPos_UpperRight, WPos_LowerRight, WPos_Center.
Returns:
TRUE if successful, otherwise FALSE.
virtual bool Display ( MCHAR *  title,
HWND  hParent,
int  x,
int  y,
int  w,
int  h 
) [pure virtual]
Remarks:
This method will display the bitmap image viewer. Note that the Show() and Hide() methods have no effect until the window is initialized by a call to Display(). For docked viewers, the hParent parameter is the window into which te viewer will be docked. For floating viewers, the parameter has no effect.

You should also not call this twice on this interface. The second time the function is called, the viewer will loose all references to the previoulsy opened window. To switch images using the same bitmap viewer, a call to "UnDisplay" should be made to close the previous window before calling this method again.
Parameters:
MCHAR *title

The title of the window to set.

HWND hParent

A handle to the parent window.

int x, y, h, w

The position and dimensions of the window.

Note that these parameters will be ignored unless 'Current Position' is WPos_NULL.
Returns:
TRUE if successful, otherwise FALSE.
virtual bool UnDisplay ( ) [pure virtual]
Remarks:
This method will undisplay the current bitmap image. The Show() and Hide() methods will no longer function after the window is destroyed.
virtual void ClearScreen ( ) [pure virtual]
Remarks:
This method will clear the bitmap image viewer window contents. This will not delete the window as it would using the Delete button on the viewer toolbar which actually deletes the contents of the bitmap.
virtual POINT XFormScreenToBitmap ( const POINT &  pt ) const [pure virtual]
Remarks:
This method will transform a specified point between the window's client coordinates and the bitmap coordinates and return the result.
Parameters:
const POINT &pt

The point on screen.
virtual POINT XFormBitmapToScreen ( const POINT &  pt ) const [pure virtual]
Remarks:
This method will transform a specified point between the window's client coordinates and the bitmap coordinates and return the result.
Parameters:
const POINT &pt

The point on the bitmap.
virtual Rect XFormScreenToBitmap ( const Rect rect ) const [pure virtual]
Remarks:
This method will transform a specified rectangle between the window's client coordinates and the bitmap coordinates and return the result.
Parameters:
const Rect &rect

The screen rectangle.
virtual Rect XFormBitmapToScreen ( const Rect rect ) const [pure virtual]
Remarks:
This method will transform a specified rectangle between the window's client coordinates and the bitmap coordinates and return the result.
Parameters:
const Rect &rect

The bitmap rectangle.
virtual void ShowToolbar ( bool  show ) [pure virtual]
Remarks:
This method allows you to set whether the toolbar should be shown as part of the bitmap image viewer window.
Parameters:
bool show

TRUE to show; FALSE to hide.
virtual void ToggleToolbar ( ) [pure virtual]
Remarks:
This method allows you to toggle the toolbar of the bitmap image viewer window on and off.
virtual void GetDrawableRect ( Rect drawableRect ) [pure virtual]
Remarks:
This method will retrieve the portion of the window's client area that is safe to draw in (in client coordinates and below the toolbar). This method can return a value larger than the displayed bitmap if the window size is large enough.
Parameters:
Rect& drawableRect

The client area.
virtual void RefreshWindow ( Rect pRefreshRegion = NULL ) [pure virtual]
Remarks:
This method will refresh the region of the window, or the entire window if region is NULL
Parameters:
Rect* pRefreshRegion = NULL

The region of the window you wish to refresh.
virtual BaseInterface* GetInterface ( Interface_ID  id ) [inline, virtual]
Remarks:
This method provides a way to extend the class with interfaces.
Parameters:
Interface_ID id

The interface ID.
Default Implementation:
{ return NULL; }

Reimplemented from IImageViewer.

{ UNUSED_PARAM(id); return NULL; }

IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer
IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer IMaxBitmapViewer