シェイプのグローエフェクトの色を読み取る
Contents
[
Hide
]
可能な使用シナリオ
Aspose.Cellsを使用して、テキストのシェイプに組み込みのWordArtスタイルを設定できます。この目的のためにFontSetting.SetWordArtStyle()またはFontSettingCollection.SetWordArtStyle()メソッドを使用してください。
テキストのシェイプに組み込みのWordArtスタイルを設定する
以下のサンプルコードは一部のテキストを含むテキストボックスを作成し、そのテキストの組み込みWordArtスタイルをFontSetting.SetWordArtStyle()メソッドを使用して設定します。このコードで生成されたエクセルファイルはMicrosoft 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 | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(SetPresetWordArtStyle.class) + "articles/"; | |
//Create workbook object | |
Workbook wb = new Workbook(); | |
//Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
//Create a textbox with some text | |
int idx = ws.getTextBoxes().add(0, 0, 100, 700); | |
TextBox tb = ws.getTextBoxes().get(idx); | |
tb.setText("Aspose File Format APIs"); | |
tb.getFont().setSize(44); | |
//Sets preset WordArt style to the text of the shape. | |
ArrayList<FontSetting> aList = tb.getCharacters(); | |
FontSetting fntSetting = aList.get(0); | |
fntSetting.setWordArtStyle(PresetWordArtStyle.WORD_ART_STYLE_3); | |
//Save the workbook in xlsx format | |
wb.save(dataDir + "SetPresetWordArtStyle_out.xlsx"); |