Get Layer Width – Plug in development

N
Posted By
normgm
Jun 29, 2004
Views
596
Replies
2
Status
Closed
I am developing a photoshop plug-in from sdk 6.0 – is there any way to get a layers width(preferably in pixels)?

Thanks
Norm.

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

J
john
Jun 29, 2004
In article ,
(Norm) wrote:

I am developing a photoshop plug-in from sdk 6.0 – is there any way to get a layers width(preferably in pixels)?

It’s the same as image size, unless you mean what it _would be_ after invoking the trim function as is used under certain Edit features.
N
normggg
Jul 6, 2004
still haven’t worked this out….

I was using the code….

/*Gets pixel width of the current layer*/
SPErr cBubble::GetLayerWidth(void)
{
SPErr error = kSPNoError;
double width;
DescriptorUnitID unit = unitPixels;
error = PIUGetInfo(classLayer,
keyWidth,
&width,
&unit);
return error;
}/*end GetLayerWidth*/

I have also tried

DescriptorUnitID unit = unitDistance;

The code was modified from

/*Gets pixel width of the document*/
SPErr cBubble::GetDocumentWidth(void)
{
SPErr error = kSPNoError;
double width;
DescriptorUnitID unit = unitPixels;
error = PIUGetInfo(classDocument,
keyWidth,
&width,
&unit);
return error;
}/*end GetLayerWidth*/

some one else mentioned something to do with filter record?

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

Related Discussion Topics

Nice and short text about related topics in discussion sections