c# WPF - Eyeshot convert model view to png file

-1

I am using devdept software Eyeshot for c# WPF - and I am new so bear with me.

To the point: I am building a WPF gui where the userinputs defines the geometry of the house (see image here).

The current display should then be saved as an PNG file when the user clicks on the Run button - but this I have not managed to do yet, here is my code:

private void Run_Click(object sender, RoutedEventArgs e)
{
Bitmap bitmap = null;
bitmap = model1.RenderToBitmap(1, 2, false);
bitmap.Save(@"C:\Users\cleve\Desktop\WPF eye\WpfApp1\WpfApp1\Resources", ImageFormat.Png);
}

In the above code "model1" is the the actual model which displayes the house.

The error i get is:

System.Runtime.InteropServices.ExternalException
  HResult=0x80004005
  Message=There was an generic error in GDI+.
  Source=System.Drawing

I have read a lot about the GDI+ error since it is a common problem but none of the solutions has helped me so fare.

Perhaps someone has an alternative way to save the image by the click of a button?

wpf
bitmap
save
png
eyeshot
asked on Stack Overflow Apr 17, 2020 by steffen bolding

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0