Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
Hey you all!
i'm developing a "Create account" window in my code.
the last step for the client is to insert a profile image to his account.
Now, since it's written in WPF (vs 2015) and C#, i want to make it a very beautiful tool for the user.
what i'm trying to do is load the image and give her a blur effect right on the start. than, using "Path" and "EllipseGeometry" i want the circle to move on the image and when it does, the part where the circle woul'd be will not be blured.
my xaml code looks like this (for now):
HTML
<grid mousemove="Grid_MouseMove" margin="0,80,158,102">
            <Image x:Name="imgProfile"
                Margin="0">
            </Image>
            <path x:name="pathZone" fill="Transparent" rendertransformorigin="0.5,0.409" xmlns:x="#unknown">
                <path.effect>
                    <blureffect radius="5" />
                </path.effect>
                <path.data>
                    <combinedgeometry geometrycombinemode="Exclude">
                        <combinedgeometry.geometry1>
                            <rectanglegeometry rect="0,0,3000,3000" />
                        </combinedgeometry.geometry1>
                        <combinedgeometry.geometry2>
                            <ellipsegeometry x:name="circle" center="75,60" radiusx="40" radiusy="40">
                            </ellipsegeometry>
                        </combinedgeometry.geometry2>
                    </combinedgeometry>
                </path.data>
            </path>
        </grid>

and in the code behind, i'm moving the circle like this:
C#
private void Grid_MouseMove(object sender, MouseEventArgs e)
        {
            circle.Center = e.GetPosition((IInputElement)sender);
        }

I must say, i'm not sure where to put the blur effect in the xaml. maybe in the path effect? the image effect? aniway, if anyone could help me i will be thankfull...

What I have tried:

i have tryed to put the image befor and after the Path, making the Path blur and making the grid itself blur.
Posted
Updated 19-Apr-16 21:25pm
v2

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