#ifndef AEEIMAGE_H
#define AEEIMAGE_H
/*======================================================
FILE:  AEEImage.h

SERVICES:  Image Interface

GENERAL DESCRIPTION:
   Base level definitions, typedefs, etc. for AEEShell

        Copyright © 1999-2002 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
=====================================================*/
#include "AEE.h"
 
// uniquely identify the IImage interface
#define AEEIID_IMAGE    0x01013110

#define IPARM_SIZE      0  // p1 = cx, p2 = cy
#define IPARM_OFFSET    1  // p1 = x, p2 = y
#define IPARM_CXFRAME   2  // p1 = cx of each frame
#define IPARM_ROP       3  // p1 = AEERasterOp (default AEE_RO_COPY)
#define IPARM_NFRAMES   4  // p1 = number of frames (cx will be calculated)
#define IPARM_RATE      5  // p1 = Animation rate in milliseconds
#define IPARM_OFFSCREEN 6  // deprecated
#define IPARM_REDRAW    7  // p1 = PFNNOTIFY, p2 = pUser
#define IPARM_DISPLAY   8  // p1 = IDisplay * to draw on
#define IPARM_GETROP    9  // p1 = pointer to rop; p2 = pointer to result code (or NULL)
#define IPARM_GETBITMAP 10 // p1 = pointer to pIBitmap; p2 = pointer to result code (or NULL)
#define IPARM_DECODER   11
#define IPARM_SCALE     12 // p1 = scaled width, p2 = scaled height

typedef void (*PFNIMAGEINFO)(void * pUser, IImage * po, AEEImageInfo * pi,int nErr);

QINTERFACE(IImage)
{
   DECLARE_IBASE(IImage)

   void        (*Draw)(IImage * po, int x, int y);
   void        (*DrawFrame)(IImage * po, int nFrame, int x, int y);
   void        (*GetInfo)(IImage * po, AEEImageInfo * pi);
   void        (*SetParm)(IImage * po, int nParm, int p1, int p2);
   void        (*Start)(IImage * po, int x, int y);
   void        (*Stop)(IImage * po);

   // Extended methods...

   void        (*SetStream)(IImage * po, IAStream * ps);
   boolean     (*HandleEvent)(IImage * po, AEEEvent evt, uint16 wParam, uint32 dwParam);
   void        (*Notify)(IImage * po, PFNIMAGEINFO pfn, void * pUser);
};

#define IIMAGE_AddRef(p)                     GET_PVTBL(p,IImage)->AddRef(p)
#define IIMAGE_Release(p)                    GET_PVTBL(p,IImage)->Release(p)
#define IIMAGE_Draw(p,x,y)                   GET_PVTBL(p,IImage)->Draw(p,x,y)
#define IIMAGE_DrawFrame(p,n,x,y)            GET_PVTBL(p,IImage)->DrawFrame(p,n,x,y)
#define IIMAGE_GetInfo(p,pi)                 GET_PVTBL(p,IImage)->GetInfo(p, pi)
#define IIMAGE_SetParm(p,n,p1,p2)            GET_PVTBL(p,IImage)->SetParm(p,n,p1,p2)
#define IIMAGE_Start(p,x,y)                  GET_PVTBL(p,IImage)->Start(p,x,y)
#define IIMAGE_Stop(p)                       GET_PVTBL(p,IImage)->Stop(p)

#define IIMAGE_SetStream(p,ps)               GET_PVTBL(p,IImage)->SetStream(p,ps)
#define IIMAGE_HandleEvent(p,e,w,d)          GET_PVTBL(p,IImage)->HandleEvent(p,e,w,d)
#define IIMAGE_Notify(p,pfn,pu)              GET_PVTBL(p,IImage)->Notify(p,pfn,pu)

#define IVIEWER_AddRef(p)                     GET_PVTBL(p,IImage)->AddRef(p)
#define IVIEWER_Release(p)                    GET_PVTBL(p,IImage)->Release(p)
#define IVIEWER_Draw(p,x,y)                   GET_PVTBL(p,IImage)->Draw(p,x,y)
#define IVIEWER_DrawFrame(p,n,x,y)            GET_PVTBL(p,IImage)->DrawFrame(p,n,x,y)
#define IVIEWER_GetInfo(p,pi)                 GET_PVTBL(p,IImage)->GetInfo(p, pi)
#define IVIEWER_SetParm(p,n,p1,p2)            GET_PVTBL(p,IImage)->SetParm(p,n,p1,p2)
#define IVIEWER_Start(p,x,y)                  GET_PVTBL(p,IImage)->Start(p,x,y)
#define IVIEWER_Stop(p)                       GET_PVTBL(p,IImage)->Stop(p)

#define IVIEWER_SetStream(p,ps)               GET_PVTBL(p,IImage)->SetStream(p,ps)
#define IVIEWER_HandleEvent(p,e,w,d)          GET_PVTBL(p,IImage)->HandleEvent(p,e,w,d)
#define IVIEWER_Notify(p,pfn,pu)              GET_PVTBL(p,IImage)->Notify(p,pfn,pu)

// Helper macros...

#define IIMAGE_SetDrawSize(p,cx,cy)          IIMAGE_SetParm(p,IPARM_SIZE,(int)cx,(int)cy)
#define IIMAGE_SetOffset(p,x,y)              IIMAGE_SetParm(p,IPARM_OFFSET,(int)x,(int)y)
#define IIMAGE_SetFrameSize(p,cx)            IIMAGE_SetParm(p,IPARM_CXFRAME,(int)cx,0)
#define IIMAGE_SetFrameCount(p,n)            IIMAGE_SetParm(p,IPARM_NFRAMES,(int)n,0)
#define IIMAGE_SetAnimationRate(p,r)         IIMAGE_SetParm(p,IPARM_RATE,(int)r,0)
#define IIMAGE_SetDisplay(p,pd)              IIMAGE_SetParm(p,IPARM_DISPLAY,(int)(pd),0)
#define IIMAGE_DrawOffscreen(p,b)            IIMAGE_SetParm(p,IPARM_OFFSCREEN,(int)b,0)

#define IVIEWER_SetDrawSize(p,cx,cy)         IIMAGE_SetParm(p,IPARM_SIZE,(int)cx,(int)cy)
#define IVIEWER_SetOffset(p,x,y)             IIMAGE_SetParm(p,IPARM_OFFSET,(int)x,(int)y)
#define IVIEWER_SetFrameSize(p,cx)           IIMAGE_SetParm(p,IPARM_CXFRAME,(int)cx,0)
#define IVIEWER_SetFrameCount(p,n)           IIMAGE_SetParm(p,IPARM_NFRAMES,(int)n,0)
#define IVIEWER_SetAnimationRate(p,r)        IIMAGE_SetParm(p,IPARM_RATE,(int)r,0)
#define IVIEWER_SetDisplay(p,pd)             IIMAGE_SetParm(p,IPARM_DISPLAY,(int)(pd),0)
#define IVIEWER_DrawOffscreen(p,b)           IIMAGE_SetParm(p,IPARM_OFFSCREEN,(int)b,0)

/*=============================================================================
   DATA STRUCTURE DOCUMENTATION
===============================================================================
AEE IImage Parameters

Description:
    The parameters defined for IImage Interface.

Definition:
    IPARM_SIZE       The actual size of the image that needs to be used for displaying purposes.
    IPARM_OFFSET     The offset within the entire image that must be used for displaying.
    IPARM_CXFRAME    The width of each frame for formats not normally supporting animation 
                     (such as Windows BMP).
    IPARM_NFRAMES    The number of frames.
    IPARM_RATE       The animation rate in milliseconds.
    IPARM_ROP        The raster operation to be used while drawing the image.
    IPARM_DISPLAY    Images are drawn/animated on the specified display.
    IPARM_SCALE      The scaled size of the image

Members:
    None

Comments:
    None

See Also:
    IIMAGE_SetParm()

=============================================================================

PFNIMAGEINFO

Description:
   
   PFNIMAGEINFO specifies the type of the callback function passed to IIMAGE_Notify().

Definition:

   typedef void (*PFNIMAGEINFO) (
      void *         pUser, 
      IImage *       pIImage, 
      AEEImageInfo * pi,
      int nErr
   );

Parameters:
 
   pUser
      User Data 
   
   pIImage
      Pointer to IIMage interface object 
   
   pi
      Pointer to image information
   
   nErr
      Error Code


Comments: 
   None.

See Also: 
   IIMAGE_Notify() 
   AEEImageInfo 

===============================================================================
   INTERFACE DOCUMENTATION
===============================================================================

IImage Interface

Description:
The IImage Interface is used for drawing bitmap images and displaying animated bitmaps
to the screen. This interface supports bitmaps in the Windows Bitmap (BMP) format
and may support a native bitmap formats specific to each device. Each instance of
the IImage Interface is associated with a single bitmap image, which can be read
in either from a resource file created with the BREW Resource Editor or directly
from a file containing the bitmap. A call to IDISPLAY_Update() or IDISPLAY_UpdateEx()
is required to update the screen.

The default BREW environment provides the IIMAGE interface for the following image formats:

   - PNG (Portable Network Graphics) 
   
   - WBMP 
   
   - JPEG 
   
   - Progressive JPEG 
   
   - BCI (Brew Compressed Image).  This format supports animation.  A BCI 
     image can be created using the BCI Authoring Tool supplied with the BREW 
     SDK.  Additional information on this format is available in the BCI 
     Authoring Tool documentation.  


The IImage Interface supports the display of animated bitmaps. An animated bitmap
consists of multiple frames that are side by side along the width of the bitmap
(for example, an animated bitmap with four 20x20 frames is 80 pixels wide and 20
pixels high). When you start animation, IImage displays the frames of the image
one after the other at a rate you specify. When the last frame has been displayed,
the animation starts again with the first frame, and IImage repeatedly cycles through
the frames until you explicitly stop the animation or release the IImage Interface
instance.

IIMAGE_Draw() draws a bitmap image on the screen at a specified position.

IIMAGE_DrawFrame() draws a single frame of an animated bitmap. IIMAGE_GetInfo()
retrieves information about a bitmap including its height and width in pixels, the
number of colors, and the number of frames it contains if the bitmap is animated.

IIMAGE_Start() starts the animation of an animated bitmap displaying its frames
at the specified screen coordinates (before you call this function, you must use
IIMAGE_SetParm() to define the number of frames in the image, as described later
in this section). IIMAGE_Stop() stops the animation with the last displayed frame
of the image remaining on the screen until it is overwritten.

IIMAGE_SetParm() sets the values of various image parameters.

===H2>
To use the IImage Interface
===/H2>

   1. Obtain an instance of the IImage Interface that contains the bitmap you choose
      to display, by doing one of the following:

      - If your bitmap is contained in a BREW resource file, call 
      ISHELL_LoadResImage(), which returns a pointer to an IImage instance that 
      contains the bitmap you specified.  
      
      - Use ISHELL_LoadImage() to load the bitmap format image directly 
      from the file.  If your bitmap is contained in a file, call 
      ISHELL_LoadImage() and pass the file name of the bitmap file.  If the 
      function is successful, it returns a valid pointer to the IImage Interface 
      object.  
      
   2. Call IIMAGE_Notify() to register for notification that decoding is complete.
      Some of the image viewers do their decoding asynchronously, so you must wait
      for this notification before proceeding to the next step.

   3. If your image is not animated, call IIMAGE_Draw() to draw the image at 
      the specified position on the screen.  If your image is animated, call 
      IIMAGE_Start() to begin animation at a specified screen position and use 
      IIMAGE_Stop() to stop the animation.  

   4. Call IIMAGE_Release() to free the IImage Interface instance.
      NOTE: This also stops animation, if necessary.


   In addition to the simple drawing ability, the IImage Interface also 
   supports animated images.  This includes image formats that do not 
   normally support animation (such as Windows BMP).  

Example
===pre>
   // If the image is a BMP, we can divide into 'frames'
   // each of which is 'cxFrames' wide as follows:

   IIMAGE_SetParm(pImage,IPARM_CXFRAME,cxFrame,0);

   // Start animating the image
   
   IIMAGE_Start(IImage,10,10);

   // Later we can stop the animation by either calling IIMAGE_Stop
   // or IIMAGE_Release.

   // Stop the animation
   
   IIMAGE_Stop(IImage);
===/pre>


The following header file is required:

   AEEImage.h

=============================================================================


IIMAGE_AddRef()


Description:
   This function is inherited from IBASE_AddRef().

See Also:
   IIMAGE_Release()
=============================================================================


IIMAGE_Draw()


Description:
   This function draws the image on the screen at the specified position.


Prototype:
   
   void IIMAGE_Draw(IImage * pIImage, int x, int y)


Parameters:

   pIImage [in]
      A valid pointer to the IImage Interface object.
   
   x [in]
      Specifies the x coordinates of the upper left corner of the destination 
      rectangular area where the image needs to be drawn.  
   
   y [in]
      Specifies the y coordinates of the upper left corner of the destination 
      rectangular area where the image needs to be drawn.  
 

Return Value:
   None


Comments:
   None

Version:
   Introduced BREW Client 1.0


See Also:
   IIMAGE_DrawFrame()


=============================================================================


IIMAGE_DrawFrame()


Description:
   This function draws a specific frame, contained within the image, on the 
   screen at the specified position.  


Prototype:
   
   void IIMAGE_DrawFrame(
      IImage * pIImage, 
      int      nFrame, 
      int      x, 
      int      y
   );


Parameters:

   pIImage [in]
      Pointer to the IImage Interface object whose frame needs to be drawn on the screen.
   
   nFrame [in]
      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 
   
   x [in]
      Specifies the x coordinates of the upper left corner of the destination 
      rectangular area where the frame needs to be drawn.  
   
   y [in] 
      Specifies the y coordinates of the upper left corner of the destination 
      rectangular area where the frame needs to be drawn.  
   
 
Return Value:
   None


Comments:
   None

Version:
   Introduced BREW Client 1.0


See Also:
   IIMAGE_Draw()


=============================================================================

IIMAGE_DrawOffscreen()

This function is deprecated in BREW Client 1.1.

=============================================================================


IIMAGE_SetDisplay()


Description:
   This function specifies the display on which the images decoded by the IImage
   object should be drawn/animated.   


Prototype:

   void IIMAGE_SetDisplay(
      IImage *    pIImage, 
      IDisplay *  pIDisplay
   );


Parameters:

   pIImage [in]
      A valid Pointer to the IImage Interface.
   
   pIDisplay [in]
      A pointer to an IDisplay Interface.  

 

Return Value:
   None


Comments:
   This function is a macro that has been implemented using:
      IIMAGE_SetParm (p, IPARM_DISPLAY, (int)b, 0)

Version:
   Introduced in BREW SDK 3.0


See Also:
   IIMAGE_SetParm()


=============================================================================


IIMAGE_GetInfo()


Description:
   This function retrieves information about the specific image.  The 
   information is returned in the AEEImageInfo data structure.  


Prototype:
   void IIMAGE_GetInfo(
      IImage *       pIImage, 
      AEEImageInfo * pi
   );


Parameters:

   pIImage [in]
      Pointer to the IImage Interface object whose information needs to be 
      retrieved.  
   
   pi [in/out]
      
      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 information contained in AEEImageInfo is as follows:
      
         cx          The width of the image (in pixels).
         
         cy          The height of the image (in pixels).
         
         nColors     The number of colors in the image.
         
         bAnimated   TRUE, if the image contains animation.
         
         cxFrame     If the image is divided into frames, this member indicates the width of
                     each frame. By default, this is set to 1.
 

Return Value:
   None


Comments:
   None

Version:
   Introduced BREW Client 1.0


See Also:
   AEEImageInfo


=============================================================================


IIMAGE_HandleEvent()


Description:
   This function passes events to an IImage Interface instance.


Prototype:
   
   boolean IIMAGE_HandleEvent(
      IImage *    pIImage, 
      AEEEvent    evt,
      uint16      wParam,
      uint32      dwParam
   );


Parameters:

   pIImage [in]
      Pointer to the IImage Interface instance that receives the event.
   
   evt [in]
      Event code.
   
   wParam [in]
      16-bit event data.
   
   dwParam [in]
      32-bit event data.
 

Return Value:

   TRUE, if the event was processed by the IImage instance.
   
   FALSE, if otherwise.


Comments:
   None

Version:
   Introduced BREW Client 1.0


See Also:
   None


=============================================================================


IIMAGE_Notify()


Description:
   This function registers a callback function that is invoked when a 
   streaming I/O operation initiated by IIMAGE_SetStream() completes 
   retrieving the image data.  


Prototype:

   void IIMAGE_Notify(
      IImage *       pIImage, 
      PFNIMAGEINFO   pfn, 
      void *         pUser
   );


Parameters:

   pIImage 
      Pointer to the IImage Interface instance whose image data is being 
      retrieved from an asynchronous stream.  
   
   pfn 
      Pointer to the callback function invoked when the image data is completely 
      available.  
   
   pUser 
      Pointer to user-specific data that is passed to the callback function.  
 

Return Value:
   None


Comments:
   None

Version:
   Introduced BREW Client 1.0


See Also:
   PFNIMAGEINFO
   IIMAGE_SetStream()


=============================================================================


IIMAGE_Release()


Description:
   This function is inherited from IBASE_Release().

Version:
   Introduced BREW Client 1.0 


See Also:
   IIMAGE_AddRef()


=============================================================================


IIMAGE_SetAnimationRate()


Description:
   This function helps to set the animation rate in milliseconds.  Invoking 
   this function is identical to invoking IIMAGE_SetParm() with IPARM_RATE.  


Prototype:
   void IIMAGE_SetAnimationRate(
      IImage * pIImage, 
      int      r
   );


Parameters:

   pIImage
      Pointer to the IImage Interface object.
   
   r
      Animation rate in milliseconds.
 



Return Value:
   None


Comments:
   This function is a macro that has been implemented using:
   IIMAGE_SetParm(p,IPARM_RATE,(int)r,0)

Version:
   Introduced BREW Client 1.1


See Also:
   IIMAGE_SetParm()


=============================================================================


IIMAGE_SetDrawSize()


Description:
   This function helps to set the actual size of the image that needs to be 
   used for displaying purposes Invoking this function is identical to 
   invoking IIMAGE_SetParm() with IPARM_SIZE.  


Prototype:

   void IIMAGE_SetDrawSize(
      IImage *    pIImage, 
      int         cx, 
      int         cy
   );


Parameters:

   pIImage
      Valid pointer to the IImage Interface.
   
   cx
      New width of the image.
   
   cy
      New height of the image.
 

Return Value:
   None


Comments:
   This function is a macro that has been implemented using:
   IIMAGE_SetParm(p,IPARM_SIZE,(int)cx,(int)cy)

Version:
   Introduced BREW Client 1.1


See Also:
   IIMAGE_SetParm()


=============================================================================


IIMAGE_SetFrameCount()


Description:
   This function helps to set the number of frames in the image Invoking this 
   function is identical to invoking IIMAGE_SetParm() with IPARM_NFRAMES.  


Prototype:

   void IIMAGE_SetFrameCount(
      IImage * pIImage, 
      int      n
   );


Parameters:

   pIImage
      Pointer to the IImage Interface.
   
   n
      Number of frames.
 

Return Value:
   None


Comments:
   This function is a macro that has been implemented using:
   IIMAGE_SetParm(p,IPARM_NFRAMES,(int)n,0)

Version:
   Introduced BREW Client 1.1


See Also:
   IIMAGE_SetParm()


=============================================================================


IIMAGE_SetFrameSize()


Description:
   This function helps to set the width of each frame for formats not 
   normally supporting animation (such as Windows BMP).  Invoking this 
   function is identical to invoking IIMAGE_SetParm with IPARM_CXFRAME.  


Prototype:

   void IIMAGE_SetFrameSize(
      IImage * pIImage, 
      int      cx
   );


Parameters:

   pIImage
      A valid Pointer to the IIMage interface
   
   cx
      Width of each frame
 

Return Value:
   None


Comments:
   This function is a macro that has been implemented using
   IIMAGE_SetParm(p,IPARM_CXFRAME,(int)cx,0)

Version:
   Introduced BREW Client 2.0


See Also:
   IIMAGE_SetParm()


=============================================================================


IIMAGE_SetOffset()


Description:
   This function helps to set the offset within the entire image that must be 
   used for display purposes.  Invoking this function is identical to 
   invoking IIMAGE_SetParm() with IPARM_OFFSET.  


Prototype:

   void IIMAGE_SetOffset(
      IImage * pIImage, 
      int      cx, 
      int      cy
   );


Parameters:

   pIImage
      Valid pointer to the IImage Interface.
   
   x
      X coordinate of the new offset.
   
   y
      Y coordinate of the new offset.
 

Return Value:
   None


Comments:
   This function is a macro that has been implemented using:
   IIMAGE_SetParm(p,IPARM_OFFSET,(int)x,(int)y)

Version:
   Introduced BREW Client 1.1


See Also:
   IIMAGE_SetParm()


=============================================================================


IIMAGE_SetParm()


Description:

This function is used for setting various image related parameters of an IImage
Interface object. The parameter to be set is specified by nParm and can be one of
the following: IPARM_SIZE, IPARM_OFFSET, IPARM_CXFRAME, IPARM_NFRAMES, IPARM_RATE,
IPARM_ROP, or IPARM_DISPLAY. The new parameter values are specified using p1 and
p2.

   - If nParm is IPARM_SIZE, this function is used to specify the size of the 
   image that needs to be used for display purposes.  The default size of the 
   image is set when it is loaded using ISHELL_LoadResImage().  If the image 
   to be considered for display must be less than the actual image that has 
   been loaded from the resource file, the size can be changed using this 
   function.  In this case, the parameters p1 and p2 specify the new width 
   and height of the image, respectively.  

   - If nParm is IPARM_OFFSET, this function specifies the offset within the 
   entire image that must be used for displaying the image.  In this case, 
   the parameters p1 and p2 specify the x and y coordinates of the image 
   offset, respectively.  The default offset is (0, 0).  
   
   - If nParm is IPARM_CXFRAME, this function specifies the parameter p1 as 
   the width of each frame.  If p1 is less than or equal to 0 (zero), the 
   frame width is set to be equal to the height of the image.  The parameter 
   p2 is not used.  
   
   NOTE: This image parameter is used only for the formats that normally 
   don't support animation (such as Windows BMP).  It is not used for formats 
   that support animation natively.  
         
   - If nParm is IPARM_NFRAMES, this function specifies the parameter p1 as 
   the number of frames.  In this case, the width of each frame is determined 
   by the total width / the number of frames.  If p1 is less than or equal to 
   0 (zero), then the number of frames is automatically calculated using the 
   formula: nFrames = WidthOfImage / HeightOfImage.  The parameter p2 is not 
   used.  
   
   NOTE: This image parameter is used only for the formats that normally 
   don't support animation (such as Windows BMP).  This is not used for 
   formats that support animation natively.  
         
   - If nParm is IPARM_RATE, this function specifies the parameter p1 as the 
   animation rate in milliseconds.  The default animation rate is 150 
   milliseconds.  The parameter p2 is not used.  
   
   NOTE: This image parameter is used only for the formats that normally 
   don't support animation, such as Windows BMP.  It is not used for formats 
   that support animation natively.  
      
   - If nParm is IPARM_ROP, this function specifies the parameter p1 as the 
   Raster operation to be used while drawing the image.  The default Raster 
   operation is AEE_RO_COPY.  The parameter p2 is not used.  
   
   - If nParm is IPARM_REDRAW, this function specifies a callback to be
   executed in lieu of drawing a frame during animation.  p1 is a PFNNOTIFY
   function pointer, and p2 is user data to be passed back to the callback.

   - If nParm is IPARM_DISPLAY, this function specifies the parameter p1 as
   the display context pointer representing the display that this image must
   be drawn to. The parameter p2 is not used.  
   
   - If nParm is IPARM_SCALE, p1 and p2 specify the scaled width and height
   of the image.  The image will be scale to this size using a bilinear
   interpolation scaling algorithm.  Setting the scaled size also resets the
   size set with IPARM_SIZE.
   

Prototype:

   void IIMAGE_SetParm(
      pImage * pIImage, 
      int      nParm, 
      int      p1, 
      int      p2
   );


Parameters:

   pIImage 
      Pointer to the IImage Interface object.
   
   nParm 
      One of the above parameter values.
         
   p1 
      nParm specific parameter value.
   
   p2 
      nParm specific parameter value.
 

Return Value:
   None


Comments:

Some of the usage examples of this function are:

   - If an image of size 50x60 has been loaded, for example, using the 
   ISHELL_LoadResImage(), and you want 30x40 for a display or animation 
   purpose, you need to call: 
   
      IIMAGE_SetParm(pIImage,IPARM_SIZE,30,40); 
   
   - In the above example, if you are interested only in that portion of the 
   image that starts at offset (10,10), you need to call: 
      
      IIMAGE_SetParm(pIImage,IPARM_OFFSET,10,10); 
   
   - If you want to split the bitmap into three frames, you need to call: 
      
      IIMAGE_SetParm(pIImage,IPARM_NFRAMES,3,0);

Version:
    Introduced BREW Client 1.1 


See Also:
   AEE IImage Parameters


=============================================================================


IIMAGE_SetStream()


Description:
   This function allows an IAStream interface to be associated with an IImage 
   Interface object to allow image data to be streamed in from a file or 
   socket.  


Prototype:

   void IIMAGE_SetStream (
      IImage *    pIImage, 
      IAStream *  pIAStream
   );


Parameters:

   pIImage 
      Pointer to the IImage Interface object that receives the streaming image 
      data input.  
         
   pIAStream 
      Pointer to an instance of a class that implements the IAStream interface 
      (for example, IFile or ISocket).  
    

Return Value:
   None


Comments:
   Both IIMAGE_Release() and IIMAGE_SetStream() will release the previous 
   stream if there is one 

Version:
   Introduced BREW Client 1.1


See Also:
   IASTREAM_Read()
   IASTREAM_Readable()


=============================================================================


IIMAGE_Start()


Description:
   This function animates the given image.  It cycles through the individual 
   frames of the image.  Each frame appears at the coordinates specified by 
   the parameter x and y.  The animation timer’s time-interval between 
   displaying of two successive frames is 150 milliseconds.  The animation 
   continues until IIMAGE_Stop() is called.  


Prototype:

   void IIMAGE_Start(
      IImage * pIImage, 
      int      x, 
      int      y
   );


Parameters:

   pIImage 
      Pointer to the IImage Interface object that needs to be animated.  
   
   x 
      Specifies the x coordinates of the upper left corner of the destination 
      rectangular area where the frame needs to be drawn.  
         
   y 
      Specifies the y coordinates of the upper left corner of the destination 
      rectangular area where the frame needs to be drawn.  
 

Return Value:
   None


Comments:
   None

Version:
   Introduced BREW Client 1.1


See Also:
   IIMAGE_Stop()


=============================================================================


IIMAGE_Stop()


Description:
   This function stops the animation of the image that was started using the 
   IIMAGE_Start().  


Prototype:
   void IIMAGE_Stop(
      IImage * pIImage
   );


Parameters:

   pIImage 
      Pointer to the IImage Interface object whose animation needs to be 
      stopped.  
    

Return Value:
   None


Comments:
   None

Version:
   Introduced BREW Client 1.1


See Also:
   IIMAGE_Start()

=======================================================================
  INTERFACES   DOCUMENTATION
=======================================================================


IViewer Interface

The IViewer Interface is identical to the IImage Interface.

The Descriptions of the IImage functions also describe the IViewer functions.

The Prototypes are the same with the exception that each place where there is IIMAGE,
it is replaced by IVIEWER.

The Parameters are the same as IImage’s parameters. The parameter pIImage is replaced
with pIViewer, which is the IViewer Interface object.

The Return Values are the same return values as shown in the IImage Interface.

The Comments applicable to the IImage functions are also applicable to the IViewer
functions.

The Side Effects applicable to the IImage functions are also applicable to the IViewer
functions.

The See Also relationship between functions in the IImage functions are also applicable
between the IViewer functions.


List of Header files to be included

The following header file is required:

AEEImage.h
=================================================================
IVIEWER_AddRef() 	
This function is identical to IIMAGE_AddRef() 
=================================================================	
IVIEWER_Release() 	
This function is identical to IIMAGE_Release() 
=================================================================	
IVIEWER_Draw()	
This function is identical to IIMAGE_Draw()
=================================================================	
IVIEWER_DrawFrame()	
This function is identical to IIMAGE_DrawFrame()
=================================================================	
IVIEWER_GetInfo()	
This function is identical to IIMAGE_GetInfo()
=================================================================	
IVIEWER_SetParm()	
This function is identical to IIMAGE_SetParm()
=================================================================	
IVIEWER_Start()	
This function is identical to IIMAGE_Start()
=================================================================	
IVIEWER_Stop() 	
This function is identical to IIMAGE_Stop() 
=================================================================	
IVIEWER_SetStream()	
This function is identical to IIMAGE_SetStream()
=================================================================	
IVIEWER_HandleEvent() 	
This function is identical to IIMAGE_HandleEvent()
=================================================================	
IVIEWER_Notify()	
This function is identical to IIMAGE_Notify()
=================================================================	
IVIEWER_SetDrawSize()	
This function is identical to IIMAGE_SetDrawSize()
=================================================================	
IVIEWER_SetOffset()	
This function is identical to IIMAGE_SetOffset()
=================================================================	
IVIEWER_SetFrameSize()	
This function is identical to IIMAGE_SetFrameSize()
=================================================================	
IVIEWER_SetFrameCount()	
This function is identical to IIMAGE_SetFrameCount()
=================================================================	
IVIEWER_SetAnimationRate()	
This function is identical to IIMAGE_SetAnimationRate()
=================================================================	
IVIEWER_SetDisplay()	
This function is identical to IIMAGE_SetDisplay()
=================================================================	
IVIEWER_DrawOffscreen()	
This function is deprecated.
=================================================================

===========================================================================*/



#endif

