Skip to main content

Microsoft Silverlight

Answered Question Moving a Canvas Top and Left valuesRSS Feed

(0)

mraath
mraath

Member

Member

16 points

17 Posts

Moving a Canvas Top and Left values

HI there

I am new to Silverlight. I want to IN CODE create a Canvas... I want to layer it over a sub-image of a DeepZoom image. Then as this image move I want to move the canvas. I have an idea as to the logic. I now just ned to know how to move a canvas.

I get it to Resize the width and height, but the Top and Left is a headacke. I tried the RenderTransform but it doesnt show up in the right place then...

Any ideas or tutorials?

Thanks

neal.gabriel
neal.gab...

Participant

Participant

789 points

161 Posts

Answered Question

Re: Moving a Canvas Top and Left values

To Move the canvas to Left

double left = 100;

double top = 100;

CanvasControl.SetValue(Canvas.LeftProperty, left);

CanvasControl.SetValue(Canvas.TopProperty, top);

Regards...

Neal Gabriel

varshavmane
varshavmane

Contributor

Contributor

6719 points

1,578 Posts

Answered Question

Re: Moving a Canvas Top and Left values

Try this:

YourCanvas.SetValue(Canvas.LeftProperty, 15);

YourCanvas.SetValue(Canvas.TopProperty, 15);

Hope this helps you.

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/

mraath
mraath

Member

Member

16 points

17 Posts

Re: Moving a Canvas Top and Left values

 This is the textbook answer although it didnt work in my situation. Will continue to look for a solution.

varshavmane
varshavmane

Contributor

Contributor

6719 points

1,578 Posts

Re: Moving a Canvas Top and Left values

Can you post your code ??

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/

mraath
mraath

Member

Member

16 points

17 Posts

Re: Moving a Canvas Top and Left values

Thanks varshavmane but its ok. I am working on a project where I want to for instance draw a line on a sub-image of a deep zoom composition. This line must zoom in and out with the image as the image zooms in and out. I thought of putting a vanvas on this image and then the line should resize with it - but it is not working - so now I am looking online for other ideas. PLease let me know if you have any ideas :) Thanks.

 

varshavmane
varshavmane

Contributor

Contributor

6719 points

1,578 Posts

Re: Re: Moving a Canvas Top and Left values

You can check this link:

http://www.cynotwhynot.com/slgallery/

and click Mouse Wheel menu. Also check the animations.

Hope it helps you.

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/

mraath
mraath

Member

Member

16 points

17 Posts

Re: Re: Moving a Canvas Top and Left values

Hi there,

Im working on a Proof of COncept regarding silverlight. I am especially wanting to proof the use of DeepZoom. I want to annotate for instance a rectangle on a particular image within the multi-image group. The problem I currently have is that the animation of the deepzoom, and my resizing and moving of the rectangle gets out of sync and then it just doesnt look that good.

Please see a primitive example here:
http://martycode.blogspot.com/2009/06/testing-my-deepzoom-page.html

Do you have any ideas as to how to fix this. I need to work on it ASAP :) Thanks a lot.

Go well,
Marthinus

varshavmane
varshavmane

Contributor

Contributor

6719 points

1,578 Posts

Re: Re: Re: Moving a Canvas Top and Left values

Check this post:

http://silverlight.net/forums/p/11283/227914.aspx

It may help you Smile

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities