HighlightText
内容
[
隐藏
]HighlightText(string, Color)
使用指定颜色突出显示样本文本的所有匹配项。
public void HighlightText(string text, Color highlightColor)
参数 | 类型 | 描述 |
---|---|---|
text | String | 要突出显示的文本。 |
highlightColor | Color | 用于突出显示文本的颜色。 |
示例
以下代码示例演示如何在PowerPoint演示文稿中突出显示文本。
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx"))
{
// 突出显示所有单独的'the'出现
presentation.HighlightText("the", Color.Violet);
presentation.Save("SomePresentation-out2.pptx", SaveFormat.Pptx);
}
另请参见
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides
HighlightText(string, Color, ITextSearchOptions, IFindResultCallback)
使用指定颜色突出显示样本文本的所有匹配项。
public void HighlightText(string text, Color highlightColor, ITextSearchOptions options,
IFindResultCallback callback)
参数 | 类型 | 描述 |
---|---|---|
text | String | 要突出显示的文本。 |
highlightColor | Color | 用于突出显示文本的颜色。 |
options | ITextSearchOptions | 文本搜索选项 ITextSearchOptions 。 |
callback | IFindResultCallback | 用于接收搜索结果的回调对象 IFindResultCallback 。 |
示例
以下代码示例演示如何在PowerPoint演示文稿中突出显示文本。
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx"))
{
// 突出显示所有单独的'the'出现
presentation.HighlightText("the", Color.Violet, new TextSearchOptions() {WholeWordsOnly = true}, null);
presentation.Save("SomePresentation-out2.pptx", SaveFormat.Pptx);
}
另请参见
- interface ITextSearchOptions
- interface IFindResultCallback
- class Presentation
- namespace Aspose.Slides
- assembly Aspose.Slides