Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. load image with open file?

load image with open file?

Scheduled Pinned Locked Moved C#
questionadobe
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arefeh Haghpnah
    wrote on last edited by
    #1

    created a program which has a "Load Picture" button, and a Picture Box .Whenever I click a "Load Picture" button, it will show a Open File Dialog then selected file will load to a picture box. My question is How I can make the picture loads to my Picture Box when User right click on a image file ---> Open With --> browse for my program. Like Photoshop, you know, when you rigt click a image file ---> Open With ---> Photoshop --> then Photoshop will open with that image file. Thanks !

    C L 2 Replies Last reply
    0
    • A Arefeh Haghpnah

      created a program which has a "Load Picture" button, and a Picture Box .Whenever I click a "Load Picture" button, it will show a Open File Dialog then selected file will load to a picture box. My question is How I can make the picture loads to my Picture Box when User right click on a image file ---> Open With --> browse for my program. Like Photoshop, you know, when you rigt click a image file ---> Open With ---> Photoshop --> then Photoshop will open with that image file. Thanks !

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Looks like you answered half your question. For the other half, you need to associate your program with the file extension in the shell, and you need to accept a program path as a command argument when your program launches.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      1 Reply Last reply
      0
      • A Arefeh Haghpnah

        created a program which has a "Load Picture" button, and a Picture Box .Whenever I click a "Load Picture" button, it will show a Open File Dialog then selected file will load to a picture box. My question is How I can make the picture loads to my Picture Box when User right click on a image file ---> Open With --> browse for my program. Like Photoshop, you know, when you rigt click a image file ---> Open With ---> Photoshop --> then Photoshop will open with that image file. Thanks !

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        use the Main method. public static void Main(string[] args) { //... args is your picture file, for example you call your app like this : //... MyApplication.exe c:\hello.jpg -> that means c:\hello.jpg will be //... in args. Then set the default application for JPG, BMP, PNG, ... to //... your application. }

        A 1 Reply Last reply
        0
        • L Lost User

          use the Main method. public static void Main(string[] args) { //... args is your picture file, for example you call your app like this : //... MyApplication.exe c:\hello.jpg -> that means c:\hello.jpg will be //... in args. Then set the default application for JPG, BMP, PNG, ... to //... your application. }

          A Offline
          A Offline
          Arefeh Haghpnah
          wrote on last edited by
          #4

          Thank you. you are very good

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups