SophiaFramework UNIVERSE 5.3 |
BREW 2.0 | BREW 2.1 | BREW 3.1 | BREW 4.0 |
---|---|---|---|
O | O | O | O |
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 SFBImage::SetParm() with IPARM_OFFSCREEN.
|
Void |
GetInfo(
AEEImageInfo* info
)
Retrieve information about the specific image.
|
Bool |
HandleEvent(
AEEEvent event
, UInt16 wParam
, UInt32 dwParam
)
Handler of SFBImage object event.
|
Bool |
HandleEvent(
SFXEventConstRef event
)
Handler of SFBImage object event.
|
static SFBImageSmp |
NewInstance(
AEECLSID id
, SFCErrorPtr exception = null
) Create a new SFBImage 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 SFBImage::SetParm() with IPARM_RATE.
|
Void |
SetDisplay(
SFBDisplaySmpConstRef display
)
Specify the display on which the images decoded by the SFBDisplay interface should be drawn/animated.
|
Void |
SetDrawSize(
SInt32 width
, SInt32 height
)
Set the dimensions of the region to be displayed.
Invoking this function is identical to invoking SFBImage::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 SFBImage::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 SFBImage::SetParm() with IPARM_CXFRAME.
|
Void |
SetOffset(
SInt32 cx
, SInt32 cy
)
Set the location within the image of the region to be displayed.
The dimensions of the region are set with SFBImage::SetDrawSize(). Invoking this
function is identical to invoking SFBImage::SetParm() with IPARM_OFFSET.
|
Void |
SetOffset(
SFXGridConstRef grid
)
Set the location within the image of the region to be displayed.
The dimensions of the region are set with SFBImage::SetDrawSize(). Invoking this
function is identical to invoking SFBImage::SetParm() with IPARM_OFFSET.
|
Void |
SetParm(
SInt32 param
, SInt32 p1
, SInt32 p2
)
Set various image related parameters of a SFBIImage Interface object.
|
Void |
SetStream(
SFBAStreamSmpConstRef stream
)
Set a SFBAStream interface to be associated with an SFBImage
Interface object to allow image data to be streamed in from a file or socket.
|
Void |
Start(
SInt32 x
, SInt32 y
)
Animate the given image.
It cycles through the individual frames of the image.
|
Void |
Start(
SFXGridConstRef grid
)
Animate the given image.
It cycles through the individual frames of the image.
|
Void |
Stop( Void )
Stop the animation of the image that was started using the SFBImage::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.
|
[ 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 grid of the upper left corner of the // destination rectangular area where the image needs to be drawn );
Draw the image which read from resourse file.
// resourse ID of bitmap which read from resourse file. #define IDB_MY_PICTURE 0x0001 SFBShellSmp shell = SFBShell::GetInstance(); SFBImageSmp image; AEEImageInfo imageInfo = {0}; // get image from resourse file. image = shell->LoadResImage(MYRESOURCE_RES_FILE, IDB_MY_PICTURE); if (image != null) { // get the information of the image. image->GetInfo(&imageInfo); // confirm whether the image has a SFBImage object. if (imageInfo.cx == 0) { DBGPRINTF("Failed to load image…!"); image.Release(); } else { // draw the image. image->Draw(0, 0); } }
[ public ] Void DrawFrame( SInt32 frame // specifies the frame that needs to be drawn. // frame numbers start from 0 (zero). nFrame 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). nFrame of -1 may be passed to draw // the "current" frame, if the image is being animated SFXGridConstRef grid // specifies the grid of the upper left corner of the // destination rectangular area where the frame needs to be drawn );
Read a BREW Compressed image (BCI) from resourse file, draw it on discretional animation frame.
// resource ID of BCI image which read from resourse file. #define IDR_MY_ANIMATION 0x0001 SFBShellSmp shell = SFBShell::GetInstance(); SFBImageSmp image; AEEImageInfo imageInfo = {0}; // get BCI image from resourse file. image = shell->LoadResImage(MYRESOURCE_RES_FILE, IDR_MY_ANIMATION); if (image != null) { // get the information of the BCI image. image->GetInfo(&imageInfo); // confirm whether SFBImage object has a BCI image. if (imageInfo.cx == 0) { DBGPRINTF("Failed to load image…!"); image.Release(); } else { // draw it on discretional animation frame. image->DrawFrame(1, 0, 0); } }
[ public ] Void GetInfo( AEEImageInfo* info // pointer to the space which is to receive the information of the image );
Get the information of the image.
// resource ID of the bitmap which read from resourse file. #define IDB_MY_PICTURE 0x0001 SFBShellSmp shell = SFBShell::GetInstance(); SFBImageSmp image; AEEImageInfo imageInfo = {0}; // get image from resourse file. image = shell->LoadResImage(MYRESOURCE_RES_FILE, IDB_MY_PICTURE); if (image != null) { // get the information of the image. image->GetInfo(&imageInfo); }
[ public ] Bool HandleEvent( AEEEvent event // event UInt16 wParam // 16-bit event data UInt32 dwParam // 32-bit event data );
[ public ] Bool HandleEvent( SFXEventConstRef event );
[ public, static ] SFBImageSmp NewInstance( AEECLSID id // ClassID SFCErrorPtr exception = null // Error );
The following values can be specified in the id argument as ClassID (* some devices don't support some of them):
For more details, see BREW API AEECLSID.
[ public ] Void Notify( PFNIMAGEINFO notify // callback function VoidPtr data = null // user data );
[ public ] Void SetDisplay( SFBDisplaySmpConstRef display // interface of SFBDisplay class );
Introduced in BREW Client 3.1
[ public ] Void SetDrawSize( SInt32 width // new width of the image SInt32 height // new height of the image );
REad a image from resourse file, draw it in specified size.
// class ID of the bitmap which read from resourse file. #define IDB_MY_PICTURE 0x0001 SFBShellSmp shell = SFBShell::GetInstance(); SFBImageSmp image; AEEImageInfo imageInfo = {0}; // get the image from resourse file. image = shell->LoadResImage(MYRESOURCE_RES_FILE, IDB_MY_PICTURE); if (image != null) { // get the information of the image. image->GetInfo(&imageInfo); // comfirm whether the SFBImage object has a image. if (imageInfo.cx == 0) { DBGPRINTF("Failed to load image…!"); image.Release(); } else { // spacify the new size of the image. image->SetDrawSize(50, 50); // draw it. image->Draw(0, 0); } }
[ 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 );
[ public ] Void SetParm( SInt32 param // type of the parameter SInt32 p1 // specific parameter value SInt32 p2 // specific parameter value );
Read a image from resourse file, Draw it in transparent mode.
// resourse ID of the bitmap which read from resourse file. #define IDB_MY_PICTURE 0x0001 SFBShellSmp shell = SFBShell::GetInstance(); SFBImageSmp image; AEEImageInfo imageInfo = {0}; // get the image from the resourse file. image = shell->LoadResImage(MYRESOURCE_RES_FILE, IDB_MY_PICTURE); if (image != null) { // get the information of the image. image->GetInfo(&imageInfo); // confirm if the SFBImage object has a image. if (imageInfo.cx == 0) { DBGPRINTF("Failed to load image…!"); image.Release(); } else { // set the image into transparent mode. image->SetParm(IPARM_ROP, AEE_RO_TRANSPARENT, 0); // draw it. image->Draw(0, 0); } }
[ public ] Void SetStream( SFBAStreamSmpConstRef stream // image data stream );
BREW API IIMAGE_SetStream | SFBAStream::Read | SFBAStream::Readable
[ 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 grid of the upper left corner of the destination // rectangular area where the frame needs to be drawn );
[ public ] Void Stop(Void);
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |