Create a photoshop plug-in

Comments and discussions about 8bf plugins which can be use in various applications like Photoshop, Paint Shop Pro or Photo-Paint
Post Reply
bogho

Create a photoshop plug-in

Post by bogho »

want to create a photoshop automation plugin, that gets all the opened images and show thm in a new dialog window. I try to use ADM functions, for dialog, images, ..., but I can not make it work; instead of drawing the current image it puts a black rectangle.
The code looks something like that:

.....
void ASAPI myDrawProc(ADMItemRef item, ADMDrawerRef inDrawer)
{

ADMImageRef imageRef = sADMImage->CreateBitmap(500,500); //this creates a copy of the current image from photoshop?
ASPoint startPoint;

startPoint.h = 0;
startPoint.v = 0;

sADMItem->DefaultDraw(item, inDrawer);
sADMImage->BeginADMDrawer(imageRef);
sADMDrawer->DrawADMImage(inDrawer, imageRef, &startPoint);
sADMImage->EndADMDrawer(imageRef);
}

//---------------------------------------------------------------------------------------------------

static ASErr ASAPI DoUIInit(ADMDialogRef dialog)
{
ASErr error = kSPNoError;

ADMItemRef item;
item = sADMDialog->GetItem(dialog, 14002); //14002 is the id for the PictureBox, in the dialog window
sADMItem->SetDrawProc(item, myDrawProc);
sADMItem->Update(item);
return error;
}

//---------------------------------------------------------------------------------------------------

SPErr DoUI ()
{
SPErr error = noErr;
int item = kDNoUI; // Error value.

SaveParameters(); // Save our parameters, just in case.
if (sADMDialog != NULL)
{
item = sADMDialog->Modal(gPlugInRef, "FrameSelection", 14000, kADMModalDialogStyle, DoUIInit, NULL, 0);
}

if (item != kDOk_button)
{
error = 'STOP'; //'STOP' = kUserCancel;
RestoreParameters();
}
return error;

}

//---------------------------------------------------------------------------------------------------

DLLExport SPAPI SPErr AutoPluginMain(const char* caller, const char* selector, void* message)
{
SPErr error = kSPNoError;
SPMessageData * basicMessage = (SPMessageData *) message;
sSPBasic = basicMessage->basic;
gPlugInRef = basicMessage->self;
if (sSPBasic->IsEqual(caller, kSPInterfaceCaller))
{
if (sSPBasic->IsEqual(selector, kSPInterfaceAboutSelector))
{
DoAbout(basicMessage->self, AboutID);
}
}

if (sSPBasic->IsEqual(caller, kPSPhotoshopCaller))
{
if (sSPBasic->IsEqual(selector, kPSDoIt))
{
PSActionsPlugInMessage * actionsMessage = (PSActionsPlugInMessage *) message;
PIActionParameters * actionParams = actionsMessage->actionParameters;
error = Execute (actionParams);
}
}

PIUSuitesRelease ();
sADMBasic.Unload();
sADMDialog.Unload();
sADMItem.Unload();
sADMNotify.Unload();
sADMList.Unload();
sADMEntry.Unload();
sADMTrack.Unload();
sADMDrawer.Unload();
return error;
}

//---------------------------------------------------------------------------------------------------

static SPErr Execute(PIActionParameters* actionParams)
{
SPErr error = kSPNoError;

Initialize();
ReadScriptParams(actionParams);

PIDialogPlayOptions playInfo = actionParams->playInfo;

if (playInfo == plugInDialogDisplay)
{
error = DoUI();
}

if (error == kSPNoError)
{
WriteScriptParams(actionParams);
}
return error;
}

//---------------------------------------------------------------------------------------------------


This code works ok if instead of drawing the image, I draw a line, a rect, etc...

Were do I get wrong?

Thanks!

HaraldHeim
Plugin Guru
Plugin Guru
Posts: 3363
Joined: Fri Mar 08, 2002 1:00 am
Location: The Plugin Site
Contact:

Post by HaraldHeim »

You will have more luck with such questions by asking thme on the Adobe SDK mailing list. You can join at
http://partners.adobe.com/asn/developer/support.jsp

bogho
Plugin Expert
Plugin Expert
Posts: 15
Joined: Mon Jun 28, 2004 9:13 am
Location: Romania
Contact:

Post by bogho »

I know about the ASN form Adobe, but there is a problem with the subscribe address
"Remote host said: 550 No such user - psmtp"

HaraldHeim
Plugin Guru
Plugin Guru
Posts: 3363
Joined: Fri Mar 08, 2002 1:00 am
Location: The Plugin Site
Contact:

Post by HaraldHeim »

Please contact owner-sdk(at)adobe.com and tell tem about the problem. Replace the (at) with @.

Post Reply