getAutoCropRect getautocroprect

根据图像的背景颜色或透明度返回图像的裁剪区域。

语法

授权用户类型 section-32dfe7bb68764b93ae01e05ff7a7bdd0

  • IpsAdmin
  • IpsCompanyAdmin
  • IpsUser
  • ImagePortalAdmin
  • ImagePortalUser
  • ImagePortalContrib
  • ImagePortalContribUser

参数 section-965d5973b8344d43a74b3e07cf0b7eb3

输入(getAutoCropRectParam)

NOTE
调用此方法时,请指定autoColorCropOptions或autoTransparentCropOptions。
名称
类型
必需
说明
companyHandle
xsd:string
公司包含要处理的资产的句柄。
assetHandle
xsd:string
要处理的资源的句柄。
autoColorCropOptions
types:AutoColorCropOptions
根据颜色计算裁切矩形。 请参阅AutoColorCropOptions
autoTransparentCropOptions
types:AutoTransparentCropOptions
根据透明度计算裁切矩形。 请参阅AutoTransparentCropOptions

输出(getAutoCropRectReturn)

名称
类型
必需
说明
xOffset
xsd:int
计算裁切区域的起始左像素坐标。
y偏移
xsd:int
计算裁切区域的起始顶部像素坐标。
宽度
xsd:int
计算裁剪区域的宽度(以像素为单位)。
高度
xsd:int
计算裁剪区域的高度(以像素为单位)。

示例 section-ba65bd66086d491cad1cea535954ee1f

请求

<getAutoCropRectParam xmlns="http://www.scene7.com/IpsApi/xsd/2012-07-31-beta">
  <companyHandle>c|3578</companyHandle>
  <assetHandle>a|3192146</assetHandle>
  <autoColorCropOptions>
    <corner>UpperLeft</corner>
    <tolerance>0.5</tolerance>
  </autoColorCropOptions>
</getAutoCropRectParam>

响应

<getAutoCropRectReturn xmlns="http://www.scene7.com/IpsApi/xsd/2012-07-31-beta">
  <xOffset>452</xOffset>
  <yOffset>66</yOffset>
  <width>1271</width>
  <height>1874</height>
</getAutoCropRectReturn>
recommendation-more-help
4e9b9d8c-5839-4215-aa35-01b652869681