PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBViewer
Wrapper Class for the IViewer interface.
#include <SFBViewer.h.hpp>
class SFBViewer : public SFBBase;
SFMTYPEDEFWRAPPER(SFBViewer)

Inheritance diagram

 Inheritance diagram of SFBViewerClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IViewer

Member

Public Functions
Void Draw( SInt32 x , SInt32 y )
Draw the image on the screen at the specified position.
Void Draw( SFXGridConstRef grid )
Draw the image on the screen at the specified position.
Void DrawFrame( SInt32 frame , SInt32 x , SInt32 y )
Draw a specific frame, contained within the image, on the screen at the specified position.
Void DrawFrame( SInt32 frame , SFXGridConstRef grid )
Draw a specific frame, contained within the image, on the screen at the specified position.
Void DrawOffscreen( SInt32 offscreen = 0 )
Specify whether the image should be drawn to the off-screen buffer or main buffer. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_OFFSCREEN.
Void GetInfo( AEEImageInfo* info )
Retrieve information about the specific image.
Bool HandleEvent( AEEEvent event , UInt16 wParam , UInt32 dwParam )
Pass events to an SFBViewer Interface instance.
Bool HandleEvent( SFXEventConstRef event )
Pass events to an SFBViewer Interface instance.
static
SFBViewerSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBViewer instance.
Void Notify( PFNIMAGEINFO notify , VoidPtr data = null )
Register a callback function that is invoked when a streaming I/O operation initiated by SFBImage::SetStream() completes retrieving the image data.
Void SetAnimationRate( SInt32 rate )
Help to set the animation rate in milliseconds. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_RATE.
Void SetDisplay( SFBDisplaySmpConstRef display )
Specify the display on which the images decoded by the SFBViewer object should be drawn/animated. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_DISPLAY.
Void SetDrawSize( SInt32 width , SInt32 height )
Set the dimensions of the region to be displayed. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_SIZE.
Void SetFrameCount( SInt32 count )
Help to set the number of frames in the image. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_NFRAMES.
Void SetFrameSize( SInt32 width )
Help to set the width of each frame for formats not normally supporting animation (such as Windows BMP). Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_CXFRAME.
Void SetOffset( SInt32 cx , SInt32 cy )
Set the offset within the image of the region to be displayed. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_OFFSET.
Void SetOffset( SFXGridConstRef grid )
Set the offset within the image of the region to be displayed. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_OFFSET.
Void SetParm( SInt32 parm , SInt32 p1 , SInt32 p2 )
Set various image related parameters.
Void SetStream( SFBAStreamSmpConstRef stream )
To input the image data as stream from file or socket, relate the SFBAStream instance with the SFBView instance.
SFCError SetStream( SFXStorageConstRef storage )
To input the image data as stream from file or socket, relate the SFBAStream instance with the SFBView instance.
Void Start( SInt32 x , SInt32 y )
Animate the given image.
Void Start( SFXGridConstRef grid )
Animate the given image.
Void Stop( Void )
Stop the animation of the image that was started using the SFBViewer::Start().
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBViewer::Draw
Draw the image on the screen at the specified position.
[ public ]
Void Draw(
    SInt32 x   // specifies the X coordinates of the upper left corner of the destination 
               //  rectangular area where the image needs to be drawn
    SInt32 y   // specifies the Y coordinates of the upper left corner of the destination 
               // rectangular area where the image needs to be drawn
);
[ public ]
Void Draw(
    SFXGridConstRef grid   // specifies the coordinates of the upper left corner of the destination 
                           // rectangular area where the image needs to be drawn
);

Reference

BREW API IVIEWER_Draw | SFBViewer::DrawFrame


SFBViewer::DrawFrame
Draw a specific frame, contained within the image, on the screen at the specified position.
[ public ]
Void DrawFrame(
    SInt32 frame   // specifies the frame that needs to be drawn. 
                   // frame numbers start from 0 (zero). 
                   // frame of -1 may be passed to draw the "current" frame, if the image is being animated
    SInt32 x       // specifies the X coordinates of the upper left corner of the destination 
                   // rectangular area where the frame needs to be drawn
    SInt32 y       // specifies the Y coordinates of the upper left corner of the destination 
                   // rectangular area where the frame needs to be drawn
);
[ public ]
Void DrawFrame(
    SInt32 frame           // specifies the frame that needs to be drawn. 
                           // frame numbers start from 0 (zero). 
                           // frame of -1 may be passed to draw the "current" frame, if the image is being animated
    SFXGridConstRef grid   // specifies the coordinates of the upper left corner of the destination 
                           // rectangular area where the frame needs to be drawn
);

Reference

BREW API IVIEWER_DrawFrame | SFBViewer::Draw


SFBViewer::DrawOffscreen
Specify whether the image should be drawn to the off-screen buffer or main buffer. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_OFFSCREEN.
[ public ]
Void DrawOffscreen(
    SInt32 offscreen = 0   // if non-zero, indicates that the image should be drawn to off-screen buffer. 
                           // if zero, indicates that the image should be drawn on the main buffer. 
                           // this feature is supported only on devices that have support for double-buffering
);

Version

This function is only available in BREW 2.1.

Reference

BREW API IVIEWER_DrawOffscreen | SFBViewer::SetParm


SFBViewer::GetInfo
Retrieve information about the specific image.
[ public ]
Void GetInfo(
    AEEImageInfo* info   // on input, this must be a valid pointer to the AEEImageInfo data structure. 
                         // on output, the data structure is filled with valid information about the image. 
                         // the member of AEEImageInfo is as below:
                         // uint16 cx;       The width of the image (in pixels) 
                         // uint16 cy;       The height of the image (in pixels) 
                         // uint16 nColors;  The number of colors in the image,
                         // uint16 nFrames;  The number of frames in the image,
                         // this is set to 1 by default
        
);

Reference

BREW API IVIEWER_GetInfo | BREW API AEEImageInfo


SFBViewer::HandleEvent
Pass events to an SFBViewer Interface instance.
[ public ]
Bool HandleEvent(
    AEEEvent event   // event code
    UInt16 wParam    // 16-bit event data
    UInt32 dwParam   // 32-bit event data
);
[ public ]
Bool HandleEvent(
    SFXEventConstRef event   // event
);

Reference

BREW API IVIEWER_HandleEvent


SFBViewer::NewInstance
Create a new SFBViewer instance.
[ public, static ]
SFBViewerSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBViewer::Notify
Register a callback function that is invoked when a streaming I/O operation initiated by SFBImage::SetStream() completes retrieving the image data.
[ public ]
Void Notify(
    PFNIMAGEINFO notify   // pointer to the callback function invoked when the image data is completely available
    VoidPtr data = null   // pointer to user-specific data that is passed to the callback function
);

Reference

BREW API IVIEWER_Notify | PFNIMAGEINFO | SFBViewer::SetStream


SFBViewer::SetAnimationRate
Help to set the animation rate in milliseconds. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_RATE.
[ public ]
Void SetAnimationRate(
    SInt32 rate   // animation rate in milliseconds
);

Version

This function is only available in BRew 2.1.

Reference

BREW API IVIEWER_SetAnimationRate | SFBViewer::SetParm


SFBViewer::SetDisplay
Specify the display on which the images decoded by the SFBViewer object should be drawn/animated. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_DISPLAY.
[ public ]
Void SetDisplay(
    SFBDisplaySmpConstRef display   // SFBDisplay interface
);

Version

This function is only available in BRew 2.1.

Reference

BREW API IVIEWER_SetDisplay


SFBViewer::SetDrawSize
Set the dimensions of the region to be displayed. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_SIZE.
[ public ]
Void SetDrawSize(
    SInt32 width    // new width of the image
    SInt32 height   // new height of the image
);

Version

This function is only available in BRew 2.1.

Reference

BREW API IVIEWER_SetDrawSize | SFBViewer::SetParm


SFBViewer::SetFrameCount
Help to set the number of frames in the image. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_NFRAMES.
[ public ]
Void SetFrameCount(
    SInt32 count   // number of frames
);

Version

This function is only available in BRew 2.1.

Reference

BREW API IVIEWER_SetFrameCount | SFBViewer::SetParm


SFBViewer::SetFrameSize
Help to set the width of each frame for formats not normally supporting animation (such as Windows BMP). Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_CXFRAME.
[ public ]
Void SetFrameSize(
    SInt32 width   // width of each frame 
);

Version

This function is only available in BRew 2.1.

Reference

BREW API IVIEWER_SetFrameSize | SFBViewer::SetParm


SFBViewer::SetOffset
Set the offset within the image of the region to be displayed. Invoking this function is identical to invoking SFBViewer::SetParm() with IPARM_OFFSET.
[ public ]
Void SetOffset(
    SInt32 cx   // X coordinate of the new offset
    SInt32 cy   // Y coordinate of the new offset
);
[ public ]
Void SetOffset(
    SFXGridConstRef grid   // grid of the new offset
);

Version

This function is only available in BRew 2.1.

Reference

BREW API IVIEWER_SetOffset | SFBViewer::SetParm


SFBViewer::SetParm
Set various image related parameters.
[ public ]
Void SetParm(
    SInt32 parm   // IPARM_SIZE, IPARM_OFFSET, IPARM_CXFRAME, IPARM_NFRAMES, IPARM_RATE, IPARM_ROP, or IPARM_OFFSCREEN
    SInt32 p1     // parm specific parameter value
    SInt32 p2     // parm specific parameter value
);

Reference

BREW API IVIEWER_SetParm


SFBViewer::SetStream
To input the image data as stream from file or socket, relate the SFBAStream instance with the SFBView instance.
[ public ]
Void SetStream(
    SFBAStreamSmpConstRef stream   // SFBAStream class
                                   // SFBFile instance or SFBSocket class, etc.
);
[ public ]
SFCError SetStream(
    SFXStorageConstRef storage   // SFBAStream class
                                 // SFBFile instance or SFBSocket class, etc.
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • storage is closed: SFERR_INVALID_STATE
  • Argument is null: SFERR_INVALID_PARAM

Reference

BREW API IVIEWER_SetStream | SFBAStream::Read | SFBAStream::Readable


SFBViewer::Start
Animate the given image.
[ public ]
Void Start(
    SInt32 x   // specifies the X coordinates of the upper left corner of the destination 
               // rectangular area where the frame needs to be drawn
    SInt32 y   // specifies the Y coordinates of the upper left corner of the destination 
               // rectangular area where the frame needs to be drawn
);
[ public ]
Void Start(
    SFXGridConstRef grid   // specifies the coordinates of the upper left corner of the destination 
                           // rectangular area where the frame needs to be drawn
);

Reference

BREW API IVIEWER_Start | SFBViewer::Stop


SFBViewer::Stop
Stop the animation of the image that was started using the SFBViewer::Start().
[ public ]
Void Stop(Void);

Reference

BREW API IVIEWER_Stop | SFBViewer::Start