FabricJS Load Image problem - Forum

Forum Navigation
You need to log in to create posts and topics.

FabricJS Load Image problem

Hi VisualNEOers!

I got a problem with FabricJS plugin, and with LoadImage function.

When I use a command like this everything works:

fabLoadImage "Container" "Test" "Picture/sample.png" 0 0

But I need to use a variable in image path like [ImageName] (which works usually with all other functions) but in FabricJS it's not working:

fabLoadImage "Container" "Test" "Picture/[ImageName].png" 0 0

and this way image will not load into the container.

Like always I'm counting on your help guys :D
Thanks!

@noyzen I think this should work:

SetVar [path]  "Picture/[ImageName].png"
fabLoadImage "Container" "Test" "[path]" 0 0

Regards.

noyzen has reacted to this post.
noyzen

Hi Luis! thank you brother for quick answers!
But I have tested this also. not working... :/

@noyzen this works for me:

fabInitialize "Container1"
SetVar [image] "avatar1.png"
SetVar [path] "./img/[image]"
fabLoadImage "Container1" "Test" "[path]" 0 0

Note that I have previously added avatar1.png to Project > Properties > Libraries/Files
Of course you will need to compile the project and use neoPhp Server to test the app.

Regards.

 

noyzen has reacted to this post.
noyzen

Heh! nice :)

my first code is also OK and it's working now, I just have to "Compile" project!
(not working in test play, but It's working in compiled app)

fabLoadImage "Container" "Test" "Picture/[ImageName].png" 0 0

Thanks for your time Luis.