We must accept finite disappointment, but we must never lose infinite hope

如何从 Photoshop中获取已打开图像的路径名

2008-03-04 21:08:30

如何从 Photoshop中获取已打开图像的路径名

 

 

因为在分割算法中要用到图像文件的路径名,而图像数据是从photoshop中读取的,所以图像路径也需要从photoshop SDK中提供的接口函数来获得。在photoshopSDKfilter插件类型下的Propetizer插件中提供了获取图像文件路径的样例代码,具体是在其

void UpdateDialogInfo (GPtr globals, HWND dp, Boolean UseProps) 函数中 通过语句  GetComplex(propTitle, 0, &complex);

PIHandle2PString(complex, ourText);

获得了图像文件的路径存储与字符数组ourText中。这两个函数的声明和定义分别来自于PIUtilities.hPIUtilities.cpp中,为photoshopSDK提供的接口函数。

#define GetComplex(key, index, complex)     \

      PIGetProp('8BIM', key, index, 0, complex)

 

#define PIGetProp             gStuff->propertyProcs->getPropertyProc

 

#define PIHandle2PString(h, s) \

      HostHandle2PString (gStuff->handleProcs, h, s)

 

void HostHandle2PString(HandleProcs *procs,

                                      Handle inDataHandle,

                                      Str255 outString)


TAG:

我来说两句

-5 -3 -1 - +1 +3 +5

Open Toolbar