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?
User contributions licensed under CC BY-SA 3.0