1

How can I convert a System.Windows.Shapes.Rectangle (WPF) to a System.Drawing.Rectangle (Windows Forms)?

Polygnome
  • 7,639
  • 2
  • 37
  • 57
Salma Bela
  • 43
  • 1
  • 4

1 Answers1

2

That would be rather pointless. A WPF System.Windows.Shapes.Rectangle is an drawing shape, like a Control. A System.Drawing.Rectangle is a mathematical object that just describes the dimensions of a rectangular shape, not something to be drawn on the screen. It has no color, no actual representation on screen, etc.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
  • alright, though how can I pass the arguments of a WPF rectangle to winForms rectangle? would it be possible cuz this later has a X,Y propreties when the first one doesn't! – Salma Bela May 11 '16 at 07:15
  • The first has a height and length property, but not a position. You could [calculate that though](http://stackoverflow.com/q/386731/993547). – Patrick Hofman May 11 '16 at 07:24