シェイプ内のテクスチャとして画像をタイル状に配置
Contents
[
Hide
]
可能な使用シナリオ
画像が小さく、品質を失うことなく形状の全体の表面をカバーしない場合、タイリングするオプションがあります。タイリングは、タイルであるかのように小さな画像で形状の表面を埋めるものです。
画像を形状の内部にテクスチャとしてタイル状にする
形状の表面にある画像を埋め、Shape.Fill.TextureFill.IsTilingプロパティを使用してtrueに設定してタイル状にすることができます。参照用に、次のサンプルコード、そのサンプルExcelファイル、出力Excelファイル、およびスクリーンショットをご覧ください。
スクリーンショット
サンプルコード
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-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"); |