HI!
I am new at automation plug develop and I want get the Image bound(position) on layer . I try code like: PIUGetInfo(classOffset,keyHorizontal,...) but it is not work at all. I try the vbs code like : docRef.ArtLayers(1).Bounds it can work. is there function or routine in photoshop SDK can get image bound? thanks!
Have you tried something like this:
DescriptorTypeID runtimeKeyID;
DescriptorTypeID runtimeClassID;
DescriptorClassID descClass;
PIActionDescriptor descLayer = NULL;
PIActionDescriptor descPosition = NULL;
double top= 0;
double left= 0;
double bottom= 0;
double right= 0;
int LayerCounter;
...
error = PIUGetInfoByIndex(LayerCounter,classLayer,0,&descLayer,NULL);
if (error) goto returnAutoError;
error = sPSActionControl->StringIDToTypeID("bounds", &runtimeKeyID);
if (error) goto returnAutoError;
error = sPSActionControl->StringIDToTypeID("classRectangle", &runtimeClassID);
if (error) goto returnAutoError;
error = PIUGetSingleItemFromDescriptor(descLayer,runtimeKeyID,&descPosition,& descClass);
if (error) goto returnAutoError;
error = sPSActionDescriptor->GetFloat(descPosition, keyTop, &top);
if (error) goto returnAutoError;
error = sPSActionDescriptor->GetFloat(descPosition, keyLeft, &left);
if (error) goto returnAutoError;
error = sPSActionDescriptor->GetFloat(descPosition, keyBottom, &bottom);
if (error) goto returnAutoError;
error = sPSActionDescriptor->GetFloat(descPosition, keyRight, &right);
if (error) goto returnAutoError;
...
returnAutoError:
if (descLayer != NULL) sPSActionDescriptor->Free(descLayer);
if (descPosition != NULL) sPSActionDescriptor->Free(descPosition);
...
Try running Getter when you have opened file in Photoshop, it will give you every information that can be get from layer. Actualy Getter makes the code as it is making or "Putting" info to Photoshop but rewritting the code is simple.
Hope this helps,
Momir Zecevic
Ars Media
www.arsmedia.tv
North America
Europe, Middle East and Africa
Asia Pacific