![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Semi-Stretching Geometry Path I am trying to build a simple shape that will join a fixed height element to a stretching, variable sized element using bezier curves. Imagine a single line of text with a blue background on the left and a list with a variable number of items on the right . The top and bottom of the text block should be joined to the top and bottom of the list box. As the list grows the curves are reshaped to accommodate the new height of the list. I have managed to easily build a template that defines this shape, but can't immediately think of a way to make it stretch correctly. I essentially want the top-left and bottom-left coords of the shape to remain static, but the top-right and bottom-right to stretch to fill the parent. My guess is that I will have to write my own shape (sub)class or use some sort of dynamic binding to bind the bezier segment's points to the height of the elements that I want to join. Is there an obvious solution to this that I am missing? |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Semi-Stretching Geometry Path Tom, I don't have an answer for you, but I wanted to add some support to this post because I am also looking for information regarding shape "stretching" and beziers in WPF. You should check out Pete Blois's totally awesome "Swoop" sample (second posting from top) @ http://www.blois.us/blog/ there is bezier usage there, and it might be a similiar effect to what you are trying to create! -Avery "Tom" wrote: > I am trying to build a simple shape that will join a fixed height > element to a stretching, variable sized element using bezier curves. > > Imagine a single line of text with a blue background on the left and a > list with a variable number of items on the right . The top and bottom > of the text block should be joined to the top and bottom of the list > box. As the list grows the curves are reshaped to accommodate the new > height of the list. > > I have managed to easily build a template that defines this shape, but > can't immediately think of a way to make it stretch correctly. I > essentially want the top-left and bottom-left coords of the shape to > remain static, but the top-right and bottom-right to stretch to fill the > parent. > > My guess is that I will have to write my own shape (sub)class or use > some sort of dynamic binding to bind the bezier segment's points to the > height of the elements that I want to join. > > Is there an obvious solution to this that I am missing? > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Semi-Stretching Geometry Path Thanks for the pointer to the example, I'll have a read. I've managed to cobble together a shape class that does what I need. In it I provide my own implementation of ArrangeOverride that stores the available space in a class level variable. After ArrangeOverride is called, Shape calls DefiningGeometry to recover the geometry it needs to draw. In my implementation of DefiningGeometry I create a geometry that fills the bounds obtained via ArrangeOverride - i.e. I have control over the way the geometry stretches. However, it's a bit of a pain to subclass shape properly. Most of the really useful methods are marked internal and I had difficulty using some of the behavior of the type. For example, I'm controlling the stretching behaviour of my geometry, so I'd like to be able to turn off the default stretching behaviour of Shape, but the method to set the stretch matrix is internal. Although my approach works, I'm not all that happy with it. I might abandon it and just using binding and normal path geometry defined in xaml. tg Avery Z wrote: > Tom, > > I don't have an answer for you, but I wanted to add some support to this > post because I am also looking for information regarding shape "stretching" > and beziers in WPF. > > You should check out Pete Blois's totally awesome "Swoop" sample (second > posting from top) @ http://www.blois.us/blog/ there is bezier usage there, > and it might be a similiar effect to what you are trying to create! > > -Avery > > "Tom" wrote: > >> I am trying to build a simple shape that will join a fixed height >> element to a stretching, variable sized element using bezier curves. >> >> Imagine a single line of text with a blue background on the left and a >> list with a variable number of items on the right . The top and bottom >> of the text block should be joined to the top and bottom of the list >> box. As the list grows the curves are reshaped to accommodate the new >> height of the list. >> >> I have managed to easily build a template that defines this shape, but >> can't immediately think of a way to make it stretch correctly. I >> essentially want the top-left and bottom-left coords of the shape to >> remain static, but the top-right and bottom-right to stretch to fill the >> parent. >> >> My guess is that I will have to write my own shape (sub)class or use >> some sort of dynamic binding to bind the bezier segment's points to the >> height of the elements that I want to join. >> >> Is there an obvious solution to this that I am missing? >> |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Faxed images stretching?!? | Vista print fax & scan | |||
| Screen geometry problem - registry??? | Vista General | |||
| BUG? (Test-Path $path -IsValid) and empty $path | PowerShell | |||