1 Attachment(s)
Open a File in Windows native program
hi again,
i got this chunk of code off the internet, i think the sample program was called "store images and files on sql server" i added the delete routine, so it is a little better than when i found it, but it opens pictures in big picturebox at the very last line, i was wondering if there's a way to call windows photo editor or something newer instead of the form it's calling, any chance for that?
Thanks,
Dan
Re: Open a File in Windows native program
ok try this. replace this code (at the end of the .doc file):
vb Code:
'set picture
Dim myPicForm As New docViewerSubForm(newImage)
myPicForm.ShowDialog()
with this:
vb Code:
Dim filename As String = My.Computer.FileSystem.GetTempFileName
newImage.Save(filename, Drawing.Imaging.ImageFormat.Jpeg)
Dim psi As New ProcessStartInfo("mspaint.exe", filename)
Process.Start(psi)
Re: Open a File in Windows native program
great, i'll give it a try in about 14 hours from now when i'm back at work, thanks!
1 Attachment(s)
Re: Open a File in Windows native program
I'm getting an error, not sure if it's because the file extentions are actully jpg instead of jpeg, intellisence wouldn't give me jpg. it would be nice to be able to open in paint, but i just heard that it's ok if they have to squash the images to one page, they can see them huge on their screens if they need to see them better (still that would be nice to open in paint tho). this is a click once app running on laptops, so i can fix that later if i can, here's the error i got, and thanks for your help! very much appreciated!
Re: Open a File in Windows native program
ok.
which version of windows are you using?
which version of vb.net are you using?
can you show me the exact code you used?
1 Attachment(s)
Re: Open a File in Windows native program
Windows XP
vb.net 2008 pro sp2
the code i used is commented out for now in dbgridview_cellcontentclick
sorry, i didn't check the forum all day, I'm headin home again, been here 11 hours, thanks for the help!
Re: Open a File in Windows native program
i'm not 100% sure why it doesn't work, although i suspect it's the useEmbeddedColorManagement parameter. try it using ImageFormat.Png