ASE Home Page Products Download Purchase Support About ASE
ChartDirector General
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Display CDML image under myDBR
Posted by phil1308 on Oct-17-2012 20:53
Hello everyone,
I'm using ChartDirector under myDBR.
I'm trying to display an image in a textbox.

My code :
$tb = $c->addText(50, 10, "xyz<*img=logo.png*>abc");

It just disdplay "xyzabc", but no image (and no error) !
I don't understand in which directory do I need to put my image ?

Nothing more even if I put the folowing code or not :
$c->setSearchPath(dirname(__FILE__));

So what is the correct way ?

thank you for help !

  Re: Display CDML image under myDBR
Posted by Peter Kwan on Oct-17-2012 22:55
Hi phil1308,

You can put the image in any directory you like. For example, you can put the image file in "/aaa/bbb/logo.png". (Note: "/aaa/bbb" refers to a directory called "/aaa/bbb" starting from the root of the hard disk or file system. It does not mean starting from the web documentation root. The path name is a file system path name, not a URL.) Then in your code, please use:

$tb = $c->addText(50, 10, "xyz<*img=/aaa/bbb/logo.png*>abc");

If you use "$c->setSearchPath(dirname(__FILE__));", you may put the image file in the same directory as your PHP script. If you are not sure where is the same directory as the PHP script, you may print it out, like:

#include the directory in the text
$tb = $c->addText(50, 10, "[" . dirname(__FILE__) ."]xyz<*img=logo.png*>abc");

Hope this can help.

Regards
Peter Kwan

  Re: Display CDML image under myDBR
Posted by phil1308 on Oct-17-2012 23:14
Once again, thank you very much !
It helped a lot.