Class ImageCropStyle
    
    
      
    
    
      
      透過集合功能整理內容
    
    
      
      你可以依據偏好儲存及分類內容。
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
圖片裁剪樣式
此類別代表可套用至圖片元件的裁剪樣式。您無法設定圖片大小或調整大小,但可以裁剪圖片。
 
內容詳盡的說明文件
setAspectRatio(ratio)
如果裁剪類型為 RECTANGLE_CUSTOM,則會設定要使用的顯示比例。比率必須為正值。
參數
| 名稱 | 類型 | 說明 | 
ratio | Number | 要套用的比率。 | 
回攻員
ImageCropStyle:這個物件用於鏈結。
擲回
Error:如果輸入值為負數或零。
 
 
 
  
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
  上次更新時間:2025-07-26 (世界標準時間)。
  
  
  
    
      [null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[],["The `ImageCropStyle` class allows users to crop images without resizing them. Key actions include setting the image crop type using `setImageCropType`, which defaults to SQUARE. For a `RECTANGLE_CUSTOM` crop type, you can set the aspect ratio via `setAspectRatio`, which requires a positive numeric value. Both methods return the `ImageCropStyle` object, enabling method chaining.  `setAspectRatio` throws an error if the ratio is zero or negative.\n"]]