Convert System.Windows.Point to System.Drawing.Point RRS feed

  • Question

  • I have been fighting this for a while, I am making a WPF DVD playback control and it works great and can even take you to the root menu, title menu, and everything. However I am trying to get it to detect my mouse when it is over an option on the DVD however I need a System.Drawing.Point and WPF uses a System.Windows.Point. So I need to be able to convert to System.Drawing.Point. Windows.Point is a double and Drawing.Point is a int.

    Thank you sooooooooo much ahead!

    Sunday, December 14, 2008 3:39 AM


  • So just instantiate one. You can either truncate or round the double values when converting them to ints.

    Point p = new Point(Convert.ToInt32(wpfPoint.X), Convert.ToInt32(wpfPoint.Y));
    Controls for WPF and Windows Forms at
    • Marked as answer by Tao Liang Tuesday, December 16, 2008 7:29 AM
    Sunday, December 14, 2008 1:38 PM