【问题标题】:photoshop scripting - getting document bit depthPhotoshop 脚本 - 获取文档位深度
【发布时间】:2013-03-07 19:16:21
【问题描述】:

如何获得当前文档的位深度 (8/16/32)? 我正在使用 JavaScript。我查看了参考手册,但找不到任何属性或功能。

【问题讨论】:

    标签: photoshop


    【解决方案1】:

    尝试使用 bitsPerChannel

    alert(activeDocument.bitsPerChannel)
    
    returns "BitsPerChannelType.EIGHT"
    

    你可能想使用这个函数来改变位深度

    convertBitDepth(8)
    
    function convertBitDepth(bitdepth)
    {
       var id1 = charIDToTypeID( "CnvM" );
       var desc1 = new ActionDescriptor();
       var id2 = charIDToTypeID( "Dpth" );
       desc1.putInteger( id2, bitdepth );
       executeAction( id1, desc1, DialogModes.NO );
    }
    

    【讨论】:

      猜你喜欢
      • 2014-03-23
      • 2020-05-26
      • 2012-10-29
      • 1970-01-01
      • 1970-01-01
      • 2018-03-09
      • 2013-09-15
      • 2011-08-05
      • 2021-09-29
      相关资源
      最近更新 更多