Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi. As i am trying to make one thing i need help with binding.
So, i have a user-control and a window. User control represents an ellipse with blurred image as ellipse fill and image with increased contrast as ellipse stroke.
User control source:
XML
<Border x:Name="src" removed="Silver">
    <Image Source="http://cs322217.vk.me/v322217001/8ceb/83F7vjpflls.jpg" Stretch="UniformToFill"></Image>
</Border>
<Border Margin="40">
    <Grid>
		<Ellipse>
			<Ellipse.Effect>
				<effects:BrightContrastEffect Brightness="0" Contrast="0.7"></effects:BrightContrastEffect>
            </Ellipse.Effect>
            <Ellipse.Fill>
				<VisualBrush Visual="{Binding ElementName=src}" Stretch="None"></VisualBrush>
			</Ellipse.Fill>
            </Ellipse>
            <Ellipse Margin="10">
                <Ellipse.BitmapEffect>
                    <BlurBitmapEffect Radius="20" x:Name="blur"></BlurBitmapEffect>
                </Ellipse.BitmapEffect>
                <Ellipse.Fill>
                    <VisualBrush Visual="{Binding ElementName=src}" Stretch="None"></VisualBrush>
                </Ellipse.Fill>
			</Ellipse>
        </Ellipse>
    </Grid>
</Border>

Window:
XML
<Grid>
	<my:control></my:control>
</Grid>

and i have this result: image of result[^]
this is the effect what i need.
But. How i can achieve the same effect, if i set the image in window:
XML
<Grid>
	<Grid.Background>
		<ImageBursh ImageSource="http://cs322217.vk.me/v322217001/8ceb/83F7vjpflls.jpg" Stretch="UniformToFill"></Image>
	</Grid.Background>
	<my:control></my:control>
</Grid>

and will remove
XML
<Border x:Name="src" removed="Silver">
    <Image Source="http://cs322217.vk.me/v322217001/8ceb/83F7vjpflls.jpg" Stretch="UniformToFill"></Image>
</Border>

from user control.
I DO NOT need this[^]. I need blurred part of image to fit the original image on window, i mean in position and scaling.
any ideas?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900