3ds Max C++ API Reference
IMaxBitmapViewer Class Referenceabstract

#include <iimageviewer.h>

+ Inheritance diagram for IMaxBitmapViewer:

Public Member Functions

virtual void SetBitmap (Bitmap *pBitmap)=0
 
virtual BitmapGetBitmap () const =0
 
virtual void SetCropCB (CropCallback *pCropCallback)=0
 
virtual CropCallbackGetCropCB () 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 (const MCHAR *title, WindowPosition position=WPos_Center)=0
 
virtual bool Display (const 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 BaseInterfaceGetInterface (Interface_ID id)
 
- Public Member Functions inherited from IImageViewer
virtual void Show ()=0
 
virtual void Hide ()=0
 
virtual HWND GetHDisplayWindow ()=0
 
virtual void SetPos (int x, int y, int w, int h)=0
 
virtual DisplayStyle GetDisplayStyle () const =0
 
virtual void SetContextHelpId (DWORD helpID)=0
 
virtual DWORD GetContextHelpId () const =0
 
virtual void SetDADMgr (DADMgr *pDADMgr)=0
 
virtual DADMgrGetDADMgr () const =0
 
virtual void SetPreEventHandlerCallback (PreEventHandlerCallback *pPreEventHandlerCB)=0
 
virtual PreEventHandlerCallbackGetPreEventHandlerCallback () const =0
 
virtual void SetPostDisplayCallback (PostDisplayCallback *pPostDisplayCB)=0
 
virtual PostDisplayCallbackGetPostDisplayCallback () const =0
 

Additional Inherited Members

- Public Types inherited from IImageViewer
enum  DisplayStyle { IV_FLOATING = 0 , IV_DOCKED }
 
enum  WindowPosition {
  WPos_NULL = 0 , WPos_UpperLeft , WPos_LowerLeft , WPos_UpperRight ,
  WPos_LowerRight , WPos_Center , WPos_Renderer = 10 , WPos_VideoPostPrimary ,
  WPos_VideoPostSecondary
}
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class IImageViewer, Class Bitmap, Class CropCallback

Description:
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.

Member Function Documentation

◆ SetBitmap()

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.

◆ GetBitmap()

virtual Bitmap* GetBitmap ( ) const
pure virtual
Remarks
This method returns a pointer to the bitmap that is being displayed by the bitmap viewer.

◆ SetCropCB()

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.

◆ GetCropCB()

virtual CropCallback* GetCropCB ( ) const
pure virtual
Remarks
This method returns a pointer to the crop callback function used by the bitmap viewer.

◆ SetAutonomous()

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.

◆ GetAutonomous()

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.

◆ SetCurrentPosition()

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.

◆ GetCurrentPosition()

virtual WindowPosition GetCurrentPosition ( ) const
pure virtual
Remarks
This method returns the current position of the bitmap viewer.

◆ SetShowSaveButton()

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.

◆ GetShowSaveButton()

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.

◆ Display() [1/2]

virtual bool Display ( const 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.

◆ Display() [2/2]

virtual bool Display ( const 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.

◆ UnDisplay()

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.

◆ ClearScreen()

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.

◆ XFormScreenToBitmap() [1/2]

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.

◆ XFormBitmapToScreen() [1/2]

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.

◆ XFormScreenToBitmap() [2/2]

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.

◆ XFormBitmapToScreen() [2/2]

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.

◆ ShowToolbar()

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.

◆ ToggleToolbar()

virtual void ToggleToolbar ( )
pure virtual
Remarks
This method allows you to toggle the toolbar of the bitmap image viewer window on and off.

◆ GetDrawableRect()

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.

◆ RefreshWindow()

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.

◆ GetInterface()

virtual BaseInterface* GetInterface ( Interface_ID  id)
inlinevirtual
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.

418 { UNUSED_PARAM(id); return NULL; }
#define UNUSED_PARAM(x)
Definition: BuildWarnings.h:18
#define NULL
Definition: autoptr.h:18