2

I need to add a picture to a spacetree to serve as a background to a spacetree. I have tried several ways but succeeded at none, mainly for the following 2 reasons: - positioning on the canvas (coordinates 0,0 do not seem to be the correct positioning. it is in the minus!) - each time the spacetree redraws, it clear the canvas.

Any help will be sincerely appreciated.

guys, what I did is straight forward: if you use the example from the infovis spacetree, please add the following right after : st.compute(); //optional: make a translation of the tree st.geom.translate(new $jit.Complex(-200, 0), "current");

//what I added 
//where myimage is an image I load in the DOM normally.

var ctx = st.canvas.getCtx(); 
var imageObj = document.getElementById("myimage"); 
ctx.drawImage(imageObj, -700, -500);
ankitr
  • 5,992
  • 7
  • 47
  • 66
FadyB
  • 21
  • 2
  • 1
    When posting to SO, it's always helpful to post the code you've tried so that we can review and point you in the right direction. – Robbert Dec 25 '13 at 06:22
  • There are lots of mistakes which could cause this behavior. With the limited information you provide, we can do nothing but guess. To find out where exactly you made a mistake, you need to create a [sscce](http://sscce.org/) which demonstrates the problem and show it to us. – Philipp Dec 25 '13 at 21:10

0 Answers0