Lavorare con l'effetto ombra di forma o grafico
Contents
[
Hide
]
Possibili scenari di utilizzo
Aspose.Cells fornisce ilShape.ShadowEffect proprietà insieme aEffetto Ombra class per lavorare con l’effetto ombra della forma o del grafico. IlEffetto Ombraclass contiene le seguenti proprietà che possono essere impostate per ottenere risultati diversi in base ai requisiti dell’applicazione.
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.
This file contains 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-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Load your source excel file | |
Workbook wb = new Workbook(dataDir + "sample.xlsx"); | |
// Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
// Access first shape | |
Shape sh = ws.Shapes[0]; | |
// Set the shadow effect of the shape, Set its Angle, Blur, Distance and Transparency properties | |
ShadowEffect se = sh.ShadowEffect; | |
se.Angle = 150; | |
se.Blur = 4; | |
se.Distance = 45; | |
se.Transparency = 0.3; | |
// Save the workbook in xlsx format | |
wb.Save(dataDir + "output_out.xlsx"); |