एंड्रॉइड पर प्रस्तुतियों में आयतें जोड़ें
सारांश
यह लेख Aspose.Slides का उपयोग करके PowerPoint स्लाइड्स में आयत आकार जोड़ने का तरीका दर्शाता है। यह एक साधारण आयत, स्वरूपित आयत बनाने, और अपडेटेड प्रेज़ेंटेशन को PPTX फ़ाइल के रूप में सहेजने को कवर करता है।
आप यह भी देखेंगे कि कैसे बुनियादी आयत फ़ॉर्मेटिंग जैसे सॉलिड फ़िल कलर, लाइन कलर, और लाइन चौड़ाई लागू की जाए। इसके अतिरिक्त, लेख का FAQ आयत से संबंधित कार्यों की ओर संकेत करता है, जिनमें गोल किनारे, चित्र फ़िल, विज़ुअल इफ़ेक्ट, हाइपरलिंक, आकार लॉक, निर्यात विकल्प, और प्रभावी गुण शामिल हैं।
स्लाइड में आयत जोड़ें
स्लाइड की चयनित प्रस्तुति में एक साधारण आयत जोड़ने के लिए नीचे दिए गए चरणों का पालन करें:
- Create an instance of Presentation class.
- Obtain the reference of a slide by using its Index.
- Add an IAutoShape of Rectangle type using addAutoShape method exposed by IShapeCollection object.
- Write the modified presentation as a PPTX file.
नीचे दिए गए उदाहरण में हमने प्रस्तुति की पहली स्लाइड में एक साधारण आयत जोड़ी है।
// PPTX को दर्शाने वाली Presentation क्लास का उदाहरण बनाएँ
Presentation pres = new Presentation();
try {
// पहली स्लाइड प्राप्त करें
ISlide sld = pres.getSlides().get_Item(0);
// ellipse प्रकार का AutoShape जोड़ें
IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 150, 50);
// PPTX फ़ाइल को डिस्क पर लिखें
pres.save("RecShp1.pptx", SaveFormat.Pptx);
} finally {
if (pres != null) pres.dispose();
}
स्लाइड में स्वरूपित आयत जोड़ें
स्लाइड में स्वरूपित आयत जोड़ने के लिए नीचे दिए गए चरणों का पालन करें:
- Create an instance of Presentation class.
- Obtain the reference of a slide by using its Index.
- Add an IAutoShape of Rectangle type using addAutoShape method exposed by IShapeCollection object.
- Set the Fill Type of the Rectangle to Solid.
- Set the Color of the Rectangle using SolidFillColor.setColor method as exposed by IFillFormat object associated with the IShape object.
- Set the Color of the lines of the Rectangle.
- Set the Width of the lines of the Rectangle.
- Write the modified presentation as PPTX file.
उपरोक्त चरण नीचे दिए गए उदाहरण में लागू किए गए हैं।
// PPTX का प्रतिनिधित्व करने वाली Presentation क्लास का उदाहरण बनाएं
Presentation pres = new Presentation();
try {
// पहली स्लाइड प्राप्त करें
ISlide sld = pres.getSlides().get_Item(0);
// ellipse प्रकार का AutoShape जोड़ें
IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 150, 50);
// ellipse आकार पर कुछ स्वरूपण लागू करें
shp.getFillFormat().setFillType(FillType.Solid);
shp.getFillFormat().getSolidFillColor().setColor(Color.GRAY);
// ellipse की लाइन पर कुछ स्वरूपण लागू करें
shp.getLineFormat().getFillFormat().setFillType(FillType.Solid);
shp.getLineFormat().getFillFormat().getSolidFillColor().setColor(Color.BLACK);
shp.getLineFormat().setWidth(5);
// PPTX फ़ाइल को डिस्क पर लिखें
pres.save("RecShp2.pptx", SaveFormat.Pptx);
} finally {
if (pres != null) pres.dispose();
}
अक्सर पूछे जाने वाले प्रश्न
मैं गोल किनारों वाली आयत कैसे जोड़ सकता हूँ?
Use the rounded-corner shape type and adjust the corner radius in the shape’s properties; rounding can also be applied per corner via geometry adjustments.
मैं आयत को चित्र (टेक्सचर) से कैसे भरूँ?
Select the picture fill type, provide the image source, and configure stretching/tiling modes.
क्या आयत में शेडो और ग्लो हो सकता है?
Yes. Outer/inner shadow, glow, and soft edges are available with adjustable parameters.
क्या मैं आयत को हाइपरलिंक के साथ बटन में बदल सकता हूँ?
Yes. Assign a hyperlink to the shape click (jump to a slide, file, web address, or e-mail).
मैं आयत को स्थान बदलने और परिवर्तन से कैसे बचा सकता हूँ?
Use shape locks: you can forbid moving, resizing, selection, or text editing to preserve the layout.
क्या मैं आयत को रास्टर इमेज या SVG में बदल सकता हूँ?
Yes. You can render the shape to an image with a specified size/scale or export it as SVG for vector use.
मैं थीम और विरासत को ध्यान में रखकर आयत के वास्तविक (प्रभावी) गुण जल्दी से कैसे प्राप्त करूँ?
Use the shape’s effective properties: the API returns computed values that account for theme styles, layout, and local settings, simplifying formatting analysis.