Click here to Skip to main content
15,889,876 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: hi peoples Pin
Christian Graus5-Jun-09 23:40
protectorChristian Graus5-Jun-09 23:40 
GeneralRe: hi peoples Pin
#realJSOP6-Jun-09 1:00
mve#realJSOP6-Jun-09 1:00 
GeneralRe: hi peoples Pin
Mark Salsbery6-Jun-09 8:22
Mark Salsbery6-Jun-09 8:22 
GeneralRe: hi peoples Pin
Christian Graus6-Jun-09 12:28
protectorChristian Graus6-Jun-09 12:28 
GeneralRe: hi peoples Pin
Mark Salsbery6-Jun-09 8:10
Mark Salsbery6-Jun-09 8:10 
GeneralRe: hi peoples Pin
Christian Graus6-Jun-09 12:30
protectorChristian Graus6-Jun-09 12:30 
AnswerRe: hi peoples Pin
Mark Salsbery6-Jun-09 8:10
Mark Salsbery6-Jun-09 8:10 
QuestionWPF - Move Image With Mouse Pin
Tee1235-Jun-09 15:02
Tee1235-Jun-09 15:02 
In my project I'm trying to get the mouse over an image and use the CaptureMouse event to move the image when I move the mouse. I'm able to move the image in the same direction as the mouse but the mouse isn't directly over the image. Here is what I have in my xaml file:
<Image Margin="116,76,113,176" Name="image1" Stretch="Fill" MouseLeftButtonDown="image1_MouseLeftButtonDown" MouseMove="image1_MouseMove" >
            <Image.RenderTransform>
                <TranslateTransform x:Name="imageTransform" X="0" Y="0" />
            </Image.RenderTransform>
        </Image>

Note: The image is inside a simple grid tag.
In my image_MouseLeftButtonDown down event I have:
image1.CaptureMouse();

In my image_MouseMove event I have:
if (Mouse.LeftButton == MouseButtonState.Pressed)
         {
             test = Mouse.GetPosition(null);
             imageTransform.X = test.X;
             imageTransform.Y = test.Y;
         }

Note: test is a Point datatype. The image follows the mouse but I can't figure out how to have the image follow the mouse when the mouse is over it. What am I doing wrong?

Terrance C.

AnswerRe: WPF - Move Image With Mouse Pin
Christian Graus5-Jun-09 23:24
protectorChristian Graus5-Jun-09 23:24 
GeneralRe: WPF - Move Image With Mouse Pin
Tee1236-Jun-09 1:30
Tee1236-Jun-09 1:30 
GeneralRe: WPF - Move Image With Mouse Pin
Mark Salsbery6-Jun-09 8:45
Mark Salsbery6-Jun-09 8:45 
JokeRe: WPF - Move Image With Mouse Pin
Christian Graus6-Jun-09 12:33
protectorChristian Graus6-Jun-09 12:33 
GeneralRe: WPF - Move Image With Mouse Pin
Mark Salsbery6-Jun-09 16:10
Mark Salsbery6-Jun-09 16:10 
GeneralRe: WPF - Move Image With Mouse Pin
Tee1238-Jun-09 7:37
Tee1238-Jun-09 7:37 
GeneralRe: WPF - Move Image With Mouse Pin
Sparkling_ouc1-Sep-09 19:46
Sparkling_ouc1-Sep-09 19:46 
QuestionWPF -Button control Pin
cbe_pav5-Jun-09 3:36
cbe_pav5-Jun-09 3:36 
AnswerRe: WPF -Button control Pin
ABitSmart5-Jun-09 3:51
ABitSmart5-Jun-09 3:51 
GeneralRe: WPF -Button control Pin
#realJSOP5-Jun-09 4:04
mve#realJSOP5-Jun-09 4:04 
GeneralRe: WPF -Button control Pin
Pete O'Hanlon5-Jun-09 4:11
mvePete O'Hanlon5-Jun-09 4:11 
GeneralRe: WPF -Button control Pin
#realJSOP5-Jun-09 4:38
mve#realJSOP5-Jun-09 4:38 
GeneralRe: WPF -Button control Pin
Christian Graus5-Jun-09 23:41
protectorChristian Graus5-Jun-09 23:41 
GeneralRe: WPF -Button control Pin
#realJSOP6-Jun-09 1:06
mve#realJSOP6-Jun-09 1:06 
GeneralRe: WPF -Button control Pin
Christian Graus6-Jun-09 12:34
protectorChristian Graus6-Jun-09 12:34 
GeneralRe: WPF -Button control Pin
cbe_pav5-Jun-09 18:31
cbe_pav5-Jun-09 18:31 
GeneralRe: WPF -Button control Pin
ABitSmart5-Jun-09 18:44
ABitSmart5-Jun-09 18:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.