load image with open file?
-
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 !
-
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 !
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.
-
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 !
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. }
-
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. }
Thank you. you are very good