Results 1 to 7 of 7

Thread: Open a File in Windows native program

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    30

    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
    Attached Files Attached Files

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: Open a File in Windows native program

    ok try this. replace this code (at the end of the .doc file):

    vb Code:
    1. 'set picture
    2. Dim myPicForm As New docViewerSubForm(newImage)
    3.  
    4. myPicForm.ShowDialog()

    with this:

    vb Code:
    1. Dim filename As String = My.Computer.FileSystem.GetTempFileName
    2. newImage.Save(filename, Drawing.Imaging.ImageFormat.Jpeg)
    3. Dim psi As New ProcessStartInfo("mspaint.exe", filename)
    4. Process.Start(psi)

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    30

    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!

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    30

    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!
    Attached Images Attached Images

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    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?

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Nov 2010
    Posts
    30

    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!
    Attached Files Attached Files

  7. #7
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width