Last post Aug 11, 2009 08:40 AM by Nick Kusters
Jul 21, 2009 06:08 PM|nsanoir|LINK
I am trying to write an image to a memorystream and then read the bytes from the memory stream and open the file with Mspaint. Below is what I have done so far. Any help would be appreciated.
'MemoryStream stream = new MemorySteam();
Dim stream As New MemoryStream()
Dim fileName As String = "ChartPicture.bmp"
Me.Response.AppendHeader("content-disposition", "attachment; filename=" & fileName)
Me.Response.ContentType = "image/bmp"
Dim oProcess As Process = New System.Diagnostics.Process()
oProcess.StartInfo.FileName = "mspaint"
Catch ex As Exception
Aug 11, 2009 08:40 AM|Nick Kusters|LINK
To open de saved image with MSPaint, you have to add the full path to the filename in the oProcess.StartInfo.Arguments property.
Try to save it to "C:\test.bmp" and set the Arguments property to "C:\test.bmp" to find out what I mean.
If you want to load it in MSPaint without saving to disk, try setting the image data to the clipboard en use sendkeys to trigger a paste.