WPF joystick control - wpf

I would like to create a joystick (x,y) control based on C# WPF - Virtual joystick using polar coordinates.
How can I animate (like a spring) the knob returning to its central position after the mouse button is released?

Related

How to record and replay control movement in WPF?

The question is that, e.g. I have a rectangle on the canvas, and I drag it with mouse (since in a physics engine, so both position and orientation will change). I want to record the movement of the rectangle as sth. like ControlAction or what else, and I have a replay button on the canvas, when I hit it, I can choose the corresponding ControlAction to replay the movement.
How can I do above work? Thank you in advance.

How to display a background control in transparent overlapping control?

I'm building a form with two layers of controls. The bottom layer is a set of Panels with defined properties, one of which is a color different from the form background. The top layer is a set of picture boxes I'm using to display a circle. I've set the PictureBox Background to Color.Transparent, and I've offset it from the underlying Panel by one pixel to get the form to draw the underlying Panel. However, the area around the circle in the PictureBox is displaying the Form Background color, not the panel color. I don't want to draw the circle in the Panel, because I want the circles to move between Panels, and actually look like just a circle that's floating across the form independent of the Panel board underneath. Think of the effect as moving a piece on a board game (you see the peg move across the board, possibly on a diagonal not following the normal game path, then stop in a place on the game).
How can I get the PictureBox to have the underlying Form and panels show through, not just the form background color? I'm using C# Visual Studio 2010, and I'm not a terribly experienced programmer, so a code example would be helpful. An image of the form is at:
http://www.imageurlhost.com/images/salgmpcxvcz830c3flt.jpg
Found a way around the problem. I got rid of the Panels for the spaces in the game, and instead drew them as rectangles on the form's background image.

Draw a point on ESRI.ArcGIS.Mobile.WPF

I am using ESRI.ArcGIS.Mobile.WPF dll to access the Map.
Using MapDoubleClick event is giving me X and Y coordinates. I need help in drawing a point on the Map based on X and Y coordinates I get from the doubleclick event.
I see that Map.Invalidate() must be used but ArcGis Mobile for WPF do not have Invalidate()

how can I draw a rectangle and circle/ellipse in WPF like we do in paint by dragging mouse

I am developing a whiteboard application in WPF.
How can I draw a rectangle and circle/ellipse by dragging the mouse like we do in Paint by dragging the mouse pointer ?
I am using WPF canvas for drawing.
have a look into below link
http://www.codeproject.com/Articles/22776/WPF-DrawTools
To run WPF-DrawTools you have to:
Let the VS to convert the project.
Set appropriate NetFramework version (say, Net 4.5).
Add references to correspondent libraries (e.g., PresentationCore) if VS could not find them itself.

Getting Relative Position of a Rotating Camera

I have a Viewport3D with a 3D model composed of multiple smaller components centered at the origin. I'm animating the PerspectiveCamera to rotate about the Y-axis using an AnimationClock created from a DoubleAnimation to create a rotating effect on the model. In addition, I have another rotateTransform3D assigned to the camera's transformgroup to enable the user to orbit around and zoom in-out of the model using the mouse.
I want to be able to translate each component as it is being selected to move in front of the rotating camera. However, I don't know how to get the position of the camera relative to the 3D model because the coordinate system of camera is being animated and transformed by the user's input.
Is there a way to get the offset between two coordinate systems?
Any help or suggestions would be appreciated.
Thanks,

Resources