int ViewAdd(int cn,char *filename, int x, int y);

 

Add a View with and attach an image to it by specifying the image filename.

 

Return Value

 

Returns an int handle to the view.

 

Parameters

 

cn

Container where the view will be added.

 

filename

The file must be located in the folder where the exe is running. This is typically inside your Visual C++ project in your /Debug folder. A filename "Ball.png" will be loaded from Debug/Ball.png. If the filename specified is "Images/Ball.png" the file will be loaded from Debug/Images/Ball.png. If a path is included in the filename, it is a relative path from the Debug folder (where the exe is running from). Use forward slashes / as needed (not backslash) and never start a filename path with a slash.

 

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.

 

x

X coordinate.

 

y

Y coordinate.

 

Remarks

 

The ViewAdd() function makes an image visible. This function internally calls ImageAdd() for you and assigns the image specified by the filename to the view.

 

Availability

 

Available in DragonFireSDK 2.0 and later.

 

Example

 

This example adds a container to the screen and subsequently adds a view with an image of a card into that container.

 

#include "DragonFireSDK.h"

 

int cn;

 

void AppMain()

{

       cn=ContainerAdd(0,10,10);

       ViewAdd(cn,"Cards/Card01.png",0,0);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

 

}