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 Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

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?

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections