Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Semi-Stretching Geometry Path

 
 
Old 03-27-2006   #1 (permalink)
Tom


 
 

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 SpecsSystem Spec
Old 03-30-2006   #2 (permalink)
Avery Z


 
 

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 SpecsSystem Spec
Old 03-30-2006   #3 (permalink)
Tom


 
 

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 SpecsSystem Spec
 

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46