private void ButtonLoad_onClick(object sender, EventArgs e)//load button
        {
            //Todo: Add ability to load image file formats also
            //OpenFileDialogue.Filter = "SVG Files (*.svg)|*.svg|Image files (*.png, *.tiff, *.tif)|*.png;.tiff;.tif|All files (*.*)|*.*";
            //This may be a significant undertaking
            //Most of these routines are built with an SVG being assumed.

            OpenFileDialogue.Filter = "SVG Files (*.svg)|*.svg|All files (*.*)|*.*";
            if (OpenFileDialogue.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            lastSourceFilename = OpenFileDialogue.FileName;


            //to minimize disk IO this is only opened once here and when it needs to be rerendered for actual field generation.
            SvgDocument d = SvgDocument.Open(OpenFileDialogue.FileName);

            lastWidthHeight             = new Tuple <float, float>(d.Width.Value, d.Height.Value);
            DecalLoaded                 = true;
            this.GenerateButton.Enabled = true;
            SourceAspect                = lastWidthHeight.Item1 / lastWidthHeight.Item2;
            int sourceHeight = 4096;
            int sourceWidth  = (int)(4096 * (1.0f / SourceAspect));

            //rendered once to memory. That file in memory is downsampled for the preview image as the window is resized.
            SourceBitmap       = SignedDistanceFieldRenderer.RenderSvgToBitmapWithMaximumSize(lastSourceFilename, sourceWidth, sourceHeight);
            decalPreview.Image = BitmapHelper.ResizeBitmapToFit(SourceBitmap, decalPreview.Width, decalPreview.Height, SourceAspect);
        }
 private void Form1_ResizeEnd(object sender, EventArgs e)
 {
     if (!Rendered)
     {
         if (DecalLoaded)
         {
             //decalPreview.Image = RenderSVGToFit(lastSourceFilename, decalPreview.Width, decalPreview.Height);
             decalPreview.Image = BitmapHelper.ResizeBitmapToFit(SourceBitmap, decalPreview.Width, decalPreview.Height, (lastWidthHeight.Item1 / lastWidthHeight.Item2));
         }
     }
     else
     {
         decalPreview.Image = lastGenerated;
     }
     centerWaitGraphic();
 }