Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is it possible to open a System.Drawing.Graphic Image in paint without having to save it first ?.. If not would it be possible to save the file temporarily, use it and then discard it again ?

 

this code requires a specific file and can't take an Image created with Graphics:

  Process.Start("mspaint.exe");

  • Leaders
Posted

I doubt you can use paint to open the image without saving it first. When you create the temporary file and launch paint, you can handle the Process.Exited event so you know when paint has closed.

 

If you want to delete the file, there is a certain way you will need to load it. Load the file into memory with File.ReadAllBytes, then create a memory stream on the array and pass it to Image.FromStream(). Image.FromFile() will keep the file open until it is disposed, so you wouldn't be able to delete it.

[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...