Results 1 to 11 of 11
- 10-21-2009, 10:33 PM #1
Member
- Join Date
- Aug 2007
- Posts
- 17
- Rep Power
- 0
Opening an image in Photoshop from a Java program
Hi everybody! I'm developing a program to manage an image listing, so, when the user has found the image that he was looking for he needs to open this image in Photoshop. How can I do this?
I found this solution in Delphi:
ShellExecute(Handle, 'Open', 'Photoshop', pchar('C:\imagen.jpg'), nil, SW_SHOW);
Is there a Java equivalent?
Please help me.
P.D.: Sorry for my English, I'm learning it too. :o
- 10-21-2009, 11:52 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,158
- Rep Power
- 5
The ProcessBuilder class allows you to execute commands from the command line. So if you know how to invoke Photoshop and load a file from the command line you should be able to do the same in java.
- 10-22-2009, 05:10 AM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
And also read bit more about Process class as well. It's helpful to have a clear idea about the ProcessBuilder usages. Start from the simple step, try to start the photoshop through the Java application first. There is an exe/executable for the photoshop, try to start that through the Java code. In next step think about that how you can pass more details (image name as your requirement...) to the process.
- 10-22-2009, 10:48 AM #4
Member
- Join Date
- Sep 2009
- Location
- Italy, Turin
- Posts
- 39
- Rep Power
- 0
Setting photoshop as the defult program to open images.. and use Desktop class? could be a solution?
you'll need just to call
desktop.open("[...]img.jpg");
perhaps in this situation it's much simpler than process builder...and you can get the same result...
- 10-22-2009, 04:11 PM #5
Member
- Join Date
- Aug 2007
- Posts
- 17
- Rep Power
- 0
Hi! Thank you for your answers. I've tried to open an image from the command line with the following:
c:/.../PhotoShop.exe "c:/image.jpeg"
I think this is the most common way to specify a file as parameter for an exe but this just opens PhotoShop and not the image.
Thank in advance.
- 10-22-2009, 04:56 PM #6
Member
- Join Date
- Sep 2009
- Location
- Italy, Turin
- Posts
- 39
- Rep Power
- 0
- 10-23-2009, 05:01 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 10-23-2009, 05:05 AM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 10-23-2009, 05:06 AM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 10-23-2009, 08:58 AM #10
Member
- Join Date
- Sep 2009
- Location
- Italy, Turin
- Posts
- 39
- Rep Power
- 0
now that i know this, i feel much better:)
anyway what are you saying is true, but if in this situation the customer need to use photoshop as a default application to open images (lots of graphics do this) this solution is quicker... if not it's not a good idea as you said before.
- 10-25-2009, 02:04 PM #11
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
[HELP]JButton opening a browser and opening a website[HELP]
By Learnin in forum AWT / SwingReplies: 4Last Post: 10-07-2009, 09:14 AM -
Opening in Java and .Net
By techinvo in forum Jobs OfferedReplies: 0Last Post: 03-22-2009, 07:24 AM -
Opening for java Professionals
By careertechy in forum Jobs OfferedReplies: 2Last Post: 01-15-2009, 12:40 PM -
[SOLVED] opening/running a program from java
By xcallmejudasx in forum New To JavaReplies: 3Last Post: 11-25-2008, 08:12 AM -
To open an image file such as Jpeg file using JAva Program
By itmani2020 in forum Advanced JavaReplies: 10Last Post: 07-11-2008, 09:57 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks