• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2746
  • Last Modified:

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

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
jvosika
Asked:
jvosika
1 Solution
 
ren_bCommented:
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
 
Kiran Paul VJComputer EngineerCommented:
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
 
zapthedingbatCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now