Solved

Open a Photoshop file (.psd) through vb code, manipulate it and save it as a .gif or .jpg

Posted on 2004-04-07
4
2,500 Views
Last Modified: 2011-09-20
I know this isnt a VB.NET category but does anyone know of a way to open a photoshop image (.psd) through vb.net code and work with it? Basically I just want to open the .psd file and save it as a .gif or .jpg

Thank you!
Jim Vosika
http://www.shipdaz.com
0
Comment
Question by:jvosika
4 Comments
 
LVL 10

Expert Comment

by:Mercantilum
ID: 10834999
0
 
LVL 6

Expert Comment

by:ren_b
ID: 10856835
the only two languages i know photoshop can interpret are javascript and applescript.

other than that, you'd have to be working with the file alone and not photoshop.
0
 
LVL 16

Expert Comment

by:kiranvj
ID: 10907427
Yes you can open a .psd file from VB ( i am using VB 6.0 since i dont have VB.NET)

This is how i tested it in VB 6.0

1. Place a button in your vb form
2. On button click event :

 Private Sub Command1_Click()
Dim return_value

return_value = ShellExecute(Form1.hwnd, "Open", "c:\b.psd", "", "", SW_SHOWMAXIMIZED)

End Sub

3. On top of Button Click event write the below code.( this is only the declration of The APIs used in the button click event). These are Private... if you want to use these APIs in different forms put them in a class module....these things u may know since u are a .Net programmer .. i think....

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWMAXIMIZED = 3

4. so the over all code will look like

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_SHOWMAXIMIZED = 3

Private Sub Command1_Click()
Dim return_value

return_value = ShellExecute(Form1.hwnd, "Open", "c:\b.psd", "", "", SW_SHOWMAXIMIZED)

End Sub

5. and by the by Place a file named b.psd in your C Drive.

6. Click the button and Photoshop will open with b.psd

hope this helps....
thank you
kiranvj
0
 
LVL 3

Accepted Solution

by:
zapthedingbat earned 500 total points
ID: 11124765
Adobe Photoshop have a COM interface for Photoshop they refer to the "scripting plugin" you can control all of photoshops functionality through this interface.

http://www.adobe.com/support/downloads/detail.jsp?ftpID=1536

Adobe supply documentation for using the COM interface, the Object Model and some scripting examples.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction When sharing photos, especially via e-mail, the large resolution images that most cameras take today make for extremely large file sizes. The time required to upload these files to forums, send in e-mails, post to blogs or even placi…
Read about why website design really matters in today's demanding market.
In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now