Lavorare con l effetto ombra di forma o grafico con C++

Possibili Scenari di Utilizzo

Aspose.Cells fornisce il metodo GetShadowEffect() insieme alla classe ShadowEffect per lavorare con l’effetto ombra di forme o grafici. La classe ShadowEffect contiene le seguenti proprietà che possono essere impostate per ottenere risultati differenti in base ai requisiti dell’applicazione.

Lavorare con l’Effetto Ombra della forma o del grafico

Il seguente esempio di codice carica il file excel sorgente e accede alla prima forma nel primo foglio di lavoro impostando le sotto-proprietà di GetShadowEffect() e poi salva il file excel di output in file excel.

#include <iostream>
#include "Aspose.Cells.h"

using namespace Aspose::Cells;
using namespace Aspose::Cells::Drawing;

int main()
{
    Aspose::Cells::Startup();

    // Source directory path
    U16String srcDir(u"..\\Data\\01_SourceDirectory\\");

    // Output directory path
    U16String outDir(u"..\\Data\\02_OutputDirectory\\");

    // Path of input excel file
    U16String inputFilePath = srcDir + u"sample.xlsx";

    // Path of output excel file
    U16String outputFilePath = outDir + u"output_out.xlsx";

    // Load your source excel file
    Workbook wb(inputFilePath);

    // 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(outputFilePath);

    std::cout << "Shadow effect applied successfully!" << std::endl;

    Aspose::Cells::Cleanup();
}