title: Scale an irregular shape to irregular bounds
body: <p>I am attempting to make a reusuable, XAML, icon. It is composed of three parts. </p>
  
  <p>Background, Bezel and Graphic Path objects. The shape is of a rectangle with the top right corner cut off, the bezel is same shape with the middle cut out and a margin of 1.</p>
  
  <p>I need the graphic path to fit inside of this with a slight margin. </p>
  
  <p>I would like it to be intelligent enough to scale itself to fit within the confines of the bezel regardless of it's shape. Like ClipToBounds only I don't want the graphic to clip - I would like it to scale. </p>
  
  <p>I initially thought setting the Margin would work, however, setting the Margin of the graphic is based on a Rectangle and not the irregular shape of the bezel; so graphics with a more rectangular shape are often touching or too close to the right-side cut off of the bezel. </p>
  
  <p>Does anyone have any ideas on how I might achieve this kind of ScaleToBounds behavior?</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>Please see attached pictures for an example of the problem. Both graphics are contained inside a ViewBox with a Margin. The circular graphic is the ideal margin I would like to see around the graphic. The rectangular graphic is too close to the bezel - I would like to have graphics such as the rectangular graphic scale themselves down slightly so they fit within the bezel with some margin.</p>
  
  <p><a href="http://s11.postimage.org/a5v05ve2n/rectangular.png" rel="nofollow noreferrer">rectangular graphic http://s11.postimage.org/a5v05ve2n/rectangular.png</a>
  <a href="http://s11.postimage.org/do7029eyn/circular.png" rel="nofollow noreferrer">circular graphic http://s11.postimage.org/do7029eyn/circular.png</a></p>