ExportOptionsPNG8
ExportOptionsPNG8
Section titled “ExportOptionsPNG8”exportOptionsPNG8
将文档导出为8位PNG文件的选项,与 Document.exportFile() 方法一起使用。所有属性都是可选的。
导出文档时,会自动附加适当的文件扩展名。您不应在文件规范中包含任何文件扩展名。
ExportOptionsPNG8.antiAliasing
Section titled “ExportOptionsPNG8.antiAliasing”exportOptionsPNG8.antiAliasing
如果为 true
,导出的图像应进行抗锯齿处理。
默认值:true
。
布尔值。
ExportOptionsPNG8.artBoardClipping
Section titled “ExportOptionsPNG8.artBoardClipping”exportOptionsPNG8.artBoardClipping
如果为 true
,导出的图像应裁剪到画板。
默认值:false
。
布尔值。
ExportOptionsPNG8.colorCount
Section titled “ExportOptionsPNG8.colorCount”exportOptionsPNG8.colorCount
导出图像颜色表中的颜色数量。
范围:2 到 256。
默认值:128。
数字(长整型)。
ExportOptionsPNG8.colorDither
Section titled “ExportOptionsPNG8.colorDither”exportOptionsPNG8.colorDither
导出图像中颜色抖动的处理方法。
默认值:ColorDitherMethod.Diffusion
。
ExportOptionsPNG8.colorReduction
Section titled “ExportOptionsPNG8.colorReduction”exportOptionsPNG8.colorReduction
导出图像中减少颜色数量的处理方法。
默认值:ColorReductionMethod.SELECTIVE
。
ExportOptionsPNG8.ditherPercent
Section titled “ExportOptionsPNG8.ditherPercent”exportOptionsPNG8.ditherPercent
导出图像中颜色抖动的百分比,其中 100.0 表示 100%。
范围:0 到 100。
默认值:88。
数字(长整型)。
ExportOptionsPNG8.horizontalScale
Section titled “ExportOptionsPNG8.horizontalScale”exportOptionsPNG8.horizontalScale
应用于导出图像的水平缩放因子,其中 100.0 表示 100%。
默认值:100.0。
数字(双精度)。
ExportOptionsPNG8.interlaced
Section titled “ExportOptionsPNG8.interlaced”exportOptionsPNG8.interlaced
如果为 true
,导出的图像应进行隔行扫描。
默认值:false
。
布尔值。
ExportOptionsPNG8.matte
Section titled “ExportOptionsPNG8.matte”exportOptionsPNG8.matte
如果为 true
,画板应使用颜色进行遮罩。
默认值:true
。
布尔值。
ExportOptionsPNG8.matteColor
Section titled “ExportOptionsPNG8.matteColor”exportOptionsPNG8.matteColor
用于遮罩画板的颜色。
默认值:white
。
ExportOptionsPNG8.saveAsHTML
Section titled “ExportOptionsPNG8.saveAsHTML”exportOptionsPNG8.saveAsHTML
如果为 true
,导出的图像将附带保存一个HTML文件。
默认值:false
。
布尔值。
ExportOptionsPNG8.transparency
Section titled “ExportOptionsPNG8.transparency”exportOptionsPNG8.transparency
如果为 true
,导出的图像将使用透明度。
默认值:true
。
布尔值。
ExportOptionsPNG8.typename
Section titled “ExportOptionsPNG8.typename”exportOptionsPNG8.typename
引用对象的类名。
字符串;只读。
ExportOptionsPNG8.verticalScale
Section titled “ExportOptionsPNG8.verticalScale”exportOptionsPNG8.verticalScale
应用于导出图像的垂直缩放因子,其中 100.0 表示 100%。
默认值:100.0。
数字(双精度)。
ExportOptionsPNG8.webSnap
Section titled “ExportOptionsPNG8.webSnap”exportOptionsPNG8.webSnap
指定颜色表应如何更改以匹配网页调色板,其中 100 为最大值。
默认值:0。
数字(长整型)。
导出为PNG8格式
Section titled “导出为PNG8格式”// 将当前文档导出为PNG8文件到指定路径,dest包含完整路径和文件名
function exportFileToPNG8(dest) { if (app.documents.length > 0) { var exportOptions = new ExportOptionsPNG8(); exportOptions.colorCount = 8; exportOptions.transparency = false;
var type = ExportType.PNG8; var fileSpec = new File(dest);
app.activeDocument.exportFile(fileSpec, type, exportOptions); }}