Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Hello,

I have a question that is outside the scope of the user guide. Lets say I have an image resource in the trig; for example, 'images/app/pic'. How would an actor access that? I have tried:

/images/app/pic
/_elem/root/images/app/pic

But the IVSNODE_GetData() returns '1'. I can probably do a workaround for this by saving the resource to a var and access that var from the actor. Just for curiosity, does anyone have an idea to access the trig image resource?

Thanks.

Try using IVFSNODE_GetData and see if it works
int IVFSNODE_GetData( IVfsNode * node, VfsPath path,
AEECLSID * pType, void * pBuf, int * pSize )
Since in question , we need an image
3rd param - Interface id (AEEIID_IMAGE)
4th param - IImage *

Try using IVFSNODE_GetData and see if it works
int IVFSNODE_GetData( IVfsNode * node, VfsPath path,
AEECLSID * pType, void * pBuf, int * pSize )
Since in question , we need an image
3rd param - Interface id (AEEIID_IMAGE)
4th param - IImage *

Right, I tried that. It always return '1'. There must be some special path that trig will recognize so that we can access the trig resource.

Right, I tried that. It always return '1'. There must be some special path that trig will recognize so that we can access the trig resource.

Rock Lee wrote:Right, I tried that. It always return '1'. There must be some special path that trig will recognize so that we can access the trig resource.
Hi,
I had an image resource "images/header" in my trig. I used the following code in my actor to fetch that image. It was working fine :) :D
Sorry in my previous post, by mistake I mentioned 4th param to be Image *. It should be Image **. [The place where the output data is to be placed.]
{
IImage *pIImage=NULL;
int nSize = 0;
AEECLSID type = 0;
AECHAR *pVFSPath[4];
// Actor root node is pIVfsRootContainer
//image
type = AEEIID_IMAGE;
nSize = sizeof(IImage **);
pVFSPath[0]= L"trig";
pVFSPath[1]= L"images";
pVFSPath[2]= L"header";
pVFSPath[3]= 0;
// Get image
nRetVal = IVFSNODE_GetData((IVfsNode * )pIVfsRootContainer,
(VfsPath)pVFSPath,(AEECLSID * )&type,
(void *)&pIImage,(int *)&nSize);
BREAKIF(nRetVal);
// Draw image
IIMAGE_Draw(pIImage,10,10);
// Release the Image
RELEASEIF(pIImage);

Rock Lee wrote:Right, I tried that. It always return '1'. There must be some special path that trig will recognize so that we can access the trig resource.
Hi,
I had an image resource "images/header" in my trig. I used the following code in my actor to fetch that image. It was working fine :) :D
Sorry in my previous post, by mistake I mentioned 4th param to be Image *. It should be Image **. [The place where the output data is to be placed.]
{
IImage *pIImage=NULL;
int nSize = 0;
AEECLSID type = 0;
AECHAR *pVFSPath[4];
// Actor root node is pIVfsRootContainer
//image
type = AEEIID_IMAGE;
nSize = sizeof(IImage **);
pVFSPath[0]= L"trig";
pVFSPath[1]= L"images";
pVFSPath[2]= L"header";
pVFSPath[3]= 0;
// Get image
nRetVal = IVFSNODE_GetData((IVfsNode * )pIVfsRootContainer,
(VfsPath)pVFSPath,(AEECLSID * )&type,
(void *)&pIImage,(int *)&nSize);
BREAKIF(nRetVal);
// Draw image
IIMAGE_Draw(pIImage,10,10);
// Release the Image
RELEASEIF(pIImage);

That worked nicely! Thanks for your help!

That worked nicely! Thanks for your help!