Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1833
  • Last Modified:

Handle photoshop plugins with Delphi

I want to make a Host Image Processing application using Delphi which can handle Adobe Photoshop plugins.

Is it possible ?

I wonder if you could give me some example... maybe some codes...  ;)
0
skycrusher
Asked:
skycrusher
  • 10
  • 5
  • 2
  • +4
1 Solution
 
intheCommented:
listening..
0
 
mhervaisCommented:
listening too
0
 
EpsylonCommented:
I have been looking for this too but did not find any component and the sdk from the PhotoShop CD's is very, very, very old...
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
yk030299Commented:
listen
0
 
skycrusherAuthor Commented:
if possible, I don't want to use a component..

regards,
skycrusher
0
 
robert_marquardtCommented:
That the API is old is no problem. Look at the old filters like KPT which continue to work with new Photoshops.
0
 
rwilson032697Commented:
Listening
0
 
EpsylonCommented:
0
 
intheCommented:
nice links mate ;-)

cant believe i had this site in my saved delphi links too..
(well not that page :o)
0
 
EpsylonCommented:
.. I hurt my nose very bad when I bumped into it  :O|
0
 
skycrusherAuthor Commented:
where can I find the PhotoShopTypeLibrary_TLB ?

regards,
skycrusher

0
 
EpsylonCommented:
It's in the Photoshop directory. Not sure if it is the right one.
0
 
EpsylonCommented:
Any success..?
0
 
EpsylonCommented:
0
 
skycrusherAuthor Commented:
Adjusted points from 400 to 500
0
 
skycrusherAuthor Commented:
I wanna know How to access the
Photoshop plugins using Delphi...

I haven't succes with it ;((
0
 
EpsylonCommented:
Epsylon changed the proposed answer to a comment
0
 
EpsylonCommented:
Ok, get ready 'coz here we go!

To get the Photoshop type library do the following in Delphi:
- Project Menu > Import Type Library
- Click 'Add' and browser to the Photoshop directory (usually C:\Program Files\Adobe\Photoshop 5.x) and select 'TypeLibrary.tlb'
- Now click on 'Create Unit'
- Save this unit to the project directoy where you want to use it
- In your project add these unit to the uses clause:

uses ComObj, ActiveX, PhotoShopTypeLibrary_TLB;


- To start Photoshop:

  PS: IPhotoShopApplication;
  AppWasRunning: boolean;
  Result: HRESULT;
  Unknown: IUnknown;

  AppWasRunning := False;
  Result := GetActiveObject(CLASS_PhotoshopApplication, nil, Unknown);
  if (Result = MK_E_UNAVAILABLE) then
    PS := CoPhotoshopApplication.Create
  else begin
    { make sure no other error occurred during GetActiveObject }
    OleCheck(Result);
    OleCheck(Unknown.QueryInterface(IPhotoShopApplication, PS));
    AppWasRunning := True;
  end;


- To make it visible:

  PS.Set_Visible(true);


- To stop Photoshop:

  PS.Quit;


- To load and save a picture:

  Pic: IAutoPSDoc;

  Pic := PS.Open('Picture.psd');
  Pic.SaveTo('Picture2.psd');


- To play an action:

  PS.PlayAction('Large Round Button');


- To apply a filter (plugin) to the active picture:

  AC: IActionControl;
  AD: IActionDescriptor;

  AC := PS.MakeControlObject;
  AD := PS.MakeDescriptor;
  AD.PutDouble(phKeyRadius, 10.3);
  AC.Play(phEventGaussianBlur, AD, phDialogSilent);

or

  AC := PS.MakeControlObject;
  AD := PS.MakeDescriptor;
  AD.PutInteger(phKeyAmount, 50);
  AC.Play(phEventSpherize, AD, phDialogSilent);



More info can be found in the SDK document 'Photoshop OLE Automation.pdf'.


Regards,

Epsylon.
0
 
EpsylonCommented:
If you need further help please say so...
0
 
skycrusherAuthor Commented:
thank you very much Epsylon...

Although I still have error msg, but I think I'll give the point to you (500)

I'll try to fix it by myself.

Once again thank you..

regards,
skycrusher
0
 
EpsylonCommented:
What error do you get? Or have you already solved it?

Maybe you use another Delphi version...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 10
  • 5
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now