Affianca l'immagine come texture all'interno della forma
Contents
[
Hide
]
Possibili scenari di utilizzo
Quando l’immagine è piccola e non copre l’intera superficie della forma senza perdere la sua qualità, allora hai la possibilità di affiancarla. La piastrellatura riempie la superficie della forma con una piccola immagine ripetendole come se fossero tessere.
Affianca l’immagine come texture all’interno della forma
Puoi riempire la superficie della forma con un’immagine e affiancarla usando ilShape.Fill.TextureFill.IsTiling proprietà e impostarlaVERO . Si prega di vedere il seguente codice di esempio, itsesempio di file Excel , suofile Excel di output così come lo screenshot per riferimento.
Immagine dello schermo
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 | |
//Load sample Excel file | |
Workbook wb = new Workbook(srcDir + "sampleTextureFill_IsTiling.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
//Access first shape inside the worksheet | |
Shape sh = ws.getShapes().get(0); | |
//Tile Picture as a Texture inside the Shape | |
sh.getFill().getTextureFill().setTiling(true); | |
//Save the output Excel file | |
wb.save(outDir + "outputTextureFill_IsTiling.xlsx"); |