int ImageSetImage(int im, char *filename);

 

Replace an existing Image with a new one.  Paths to the file named in the filename parameter are relative to your application's Assets folder.

 

Return Value

 

Returns an int handle to the loaded image.

 

Parameters

 

im

Handle to a previously loaded Image.

 

filename

Name of the image file to be loaded.  The PNG file format is the only supported image format.

 

The path to the file named in this parameter must be in the Assets folder where your application resides.  (Typically, your project's Debug or Release folder.  For example, if your project is in C:\DragonFireSDK\, your Assets folder will be C:\DragonFireSDK\Debug\Assets or C:\DragonFireSDK\Release\Assets.)

 

NOTE: The file system used by iOS is case sensitive, so be sure to match the case of the file name in your code to that of the file on your computer.

 

Remarks

 

The ImageSetImage() function loads the file specified by filename to memory into the Image specified.  The prior  Image is freed from memory.

 

NOTE: You should only use ImageSetImage() in cases where you need to display more images than you would be able to load at startup (for example, animation of a large portion of the screen).

 

Availability

 

Available in DragonFireSDK 1.4 and later.

 

Example

 

#include "DragonFireSDK.h"

 

int MyImage;

int MyView;

int Counter;

char FileName[100];

 

void AppMain()

{

  Counter = 0;

  MyImage = ImageAdd("Images/Image0.png");

  MyView = ViewAdd(MyImage, 20, 20);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

  Counter++;  

  if (Counter == 30)

     Counter = 0;

 

  sprintf(FileName, "Images/Image%d.png", Counter);

  ImageSetImage(MyImage, FileName);

}