Class ImageCropStyle
इमेजकाटेंस्टाइल
यह एक क्लास है, जो इमेज कॉम्पोनेंट पर लागू की जा सकने वाली काट-छांट की स्टाइल दिखाती है. इमेज का साइज़ सेट नहीं किया जा सकता या उसका साइज़ नहीं बदला जा सकता. हालांकि, इमेज को क्रॉप किया जा सकता है.
ज़्यादा जानकारी वाला दस्तावेज़
setAspectRatio(ratio)
अगर काटने का टाइप RECTANGLE_CUSTOM
है, तो इस्तेमाल करने के लिए आसपेक्ट रेशियो सेट करता है. अनुपात एक पॉज़िटिव वैल्यू होना चाहिए.
पैरामीटर
नाम | टाइप | ब्यौरा |
ratio | Number | लागू किया जाने वाला अनुपात. |
वापसी का टिकट
ImageCropStyle
— चेन करने के लिए यह ऑब्जेक्ट.
थ्रो
Error
— अगर इनपुट नेगेटिव या शून्य है.
setImageCropType(type)
इमेज के लिए काटने का टाइप सेट करता है. डिफ़ॉल्ट रूप से, SQUARE का इस्तेमाल किया जाता है.
पैरामीटर
वापसी का टिकट
ImageCropStyle
— चेन करने के लिए यह ऑब्जेक्ट.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2024-12-02 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2024-12-02 (UTC) को अपडेट किया गया."],[[["`ImageCropStyle` allows cropping images within Google Apps Script, but not resizing them directly."],["Two main methods, `setAspectRatio` and `setImageCropType`, provide control over the cropping process."],["`setAspectRatio` is applicable only when using the `RECTANGLE_CUSTOM` crop type and requires a positive ratio value."],["`setImageCropType` lets you choose the shape of the crop, with `SQUARE` being the default option."],["Both methods return the `ImageCropStyle` object, enabling method chaining for streamlined code."]]],["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"]]