Lavorare con l'effetto ombra di forma o grafico
Contents
[
Hide
]
Possibili scenari di utilizzo
Aspose.Cells fornisce ilShape.ShadowEffectproprietà per lavorare con l’effetto ombra della forma o del grafico. Contiene le seguenti proprietà secondarie che è possibile impostare per ottenere risultati diversi in base alle proprie esigenze.
- ShadowEffect.Angle
- ShadowEffect.Blur
- ShadowEffect.Color
- ShadowEffect.Distance
- ShadowEffect.PresetType
- ShadowEffect.Size
- ShadowEffect.Transparency
Lo screenshot seguente mostra l’interfaccia di Excel Microsoft per impostare il fileEffetto ombradi Forma.
Lavorare con l’effetto ombra di forma o grafico
Il codice di esempio seguente carica il filefile excel di origine e accede alla prima forma nel primo foglio di lavoro e imposta le proprietà secondarie diShape.ShadowEffectproprietà e quindi salva la cartella di lavoro nel filefile excel di output.
Codice d’esempio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(WorkingWithShadowEffect.class) + "articles/"; | |
// Loads the workbook which contains hidden external links | |
Workbook wb = new Workbook(dataDir + "WorkingWithShadowEffect_in.xlsx"); | |
// Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
// Access first shape | |
Shape sh = ws.getShapes().get(0); | |
// Set the shadow effect of the shape | |
// Set its Angle, Blur, Distance and Transparency properties | |
ShadowEffect se = sh.getShadowEffect(); | |
se.setAngle(150); | |
se.setBlur(4); | |
se.setDistance(45); | |
se.setTransparency(0.3); | |
// Save the workbook in xlsx format | |
wb.save(dataDir + "WorkingWithShadowEffect_out.xlsx"); |