Keeping the points (x,y) relative!
-
Thursday, July 12, 2012 11:37 AM
Hi,
I have a strange problem. I am designing few things in Adobe Illustrator.
I import those to a page in Blend to a Canvas.When I do this the points in the path are like (200,300) what it was in illustrator etc, and relative to the canvas, in which case they should be (2,3). Hope you are getting my point. I need these points for calculations. So only choice I have is to draw the path in Blend to have the accurate point (x,y).
Can I make all points relative to their parent canvas?
Thanks in advance :)
Please Mark as Answered If this answers your question Or UnMark as Answered if it did not.
Happy to Help :)
My Site- Changed Type vijaykamat Thursday, July 12, 2012 11:42 AM
All Replies
-
Thursday, July 12, 2012 2:37 PM
I am kinda confused. From what I understand about canvases is that items within them are relative to their top and left. So, w/e you're putting on your canvas is already relative. I have a few questions to clarify the problem. 200 and 300 what? pixels? From the top and left? 2 and 3 what? From the top left?
Items placed in the canvas control are relative. That's how the canvas works. Are you sure you are working on a canvas?
-
Friday, July 13, 2012 4:02 AM
Ok Let me explain in detail.
What I am specifically talking about is the points on a path. Points on the path have values staring from M(x,y), (x,y)... (x,y)z
These x and y values remain what they are once they are drawn, wherever you move them on canvas nothing changes (except Canvas.Let/Top). In my case these are drawn in Illustrator and imported to canvas in Blend. The points remain the same, I want them to change. Once I import the paths to Canvas I want them to get relative values to left and top of canvas.
Ex:
Original Path <Path Data="M8.3672,10.5664C8.3672,10.5664,10.7682,8.3794,13.7842,7.0974C16.8002,.........
After the import and alteration intended: <Path Data="M3.713,5 C-0.99512541,9.2205923 -0.3568478,13.637637 4.46300...
Hope I am more clear this time :)
Please Mark as Answered If this answers your question Or UnMark as Answered if it did not.
Happy to Help :)
My Site -
Thursday, July 26, 2012 9:17 PM
Are you saying you want to animate the points in the path? How about this:
-
Thursday, August 02, 2012 4:02 AM
No its not about animation!
If I draw a path on a canvas (right in the centre) and then copy paste this path to another canvas I want the points on the path to get relative to that canvas!
Please Mark as Answered If this answers your question Or UnMark as Answered if it did not.
Happy to Help :)
My Site -
Thursday, August 02, 2012 6:52 PM
I may not be visualizing your dilemma correctly, but it sounds like a quick and simple work-around would be to embed Canvas A into a ViewBox, then drop that ViewBox into Canvas B (Or whatever container you're using) with the ViewBox's Horizontal/Vertical set to Stretch?
If I'm mistaken, maybe a quick and dirty visual example might help define the question a little better?
Please mark answers as helpful when used, and answered when completed. -
Friday, August 03, 2012 4:44 PM
Hello vjjaykamat.
I suspect what you mean is that something like these 2 paths produce the same shape(path) but the points used are not actual points on the canvas/container or relative to their size.
<Path Data="M0,0 L100,0 L100,100 L0,100 z" Fill="Blue" HorizontalAlignment="Left" Height="100" Margin="8,8,0,0" Stretch="Fill" Stroke="Black" VerticalAlignment="Top" Width="100"/>
<Path Data="M0,0 L1,0 L1,1 L0,1 z" Fill="Blue" HorizontalAlignment="Left" Height="100" Margin="112,8,0,0" Stretch="Fill" Stroke="Black" VerticalAlignment="Top" Width="100"/>
My experience is that the points in the path data are relative to their position in the actual path and not the path's size or position in the container. The only way I see around this is to manually calculate each point. Possibly create a converter.
Is that what you are referring to?
~Christine
-
Tuesday, October 09, 2012 9:32 AM
Hi Christine,
Yes you are right, that's what I want, and as I found out, there is no short cut way to do this, so I am re-drawing all the shapes.
Thank you for your time :)
Please Mark as Answered If this answers your question Or UnMark as Answered if it did not.
Happy to Help :)
My Site

