HighlightText
Contenu
[
Cacher
]HighlightText(string, Color)
Met en évidence toutes les occurrences du texte d’exemple avec la couleur spécifiée.
public void HighlightText(string text, Color highlightColor)
Paramètre | Type | Description |
---|---|---|
text | String | Le texte à surligner. |
highlightColor | Color | La couleur pour surligner le texte. |
Voir Aussi
- interface ITextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides
HighlightText(string, Color, ITextSearchOptions, IFindResultCallback)
Met en évidence toutes les occurrences du texte d’exemple avec la couleur spécifiée.
public void HighlightText(string text, Color highlightColor, ITextSearchOptions options,
IFindResultCallback callback)
Paramètre | Type | Description |
---|---|---|
text | String | Le texte à surligner. |
highlightColor | Color | La couleur pour surligner le texte. |
options | ITextSearchOptions | Options de recherche de texte ITextSearchOptions . |
callback | IFindResultCallback | L’objet de rappel pour recevoir les résultats de recherche IFindResultCallback . |
Exemples
L’exemple de code suivant montre comment surligner du texte dans un TextFrame.
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx"))
{
// surligner tous les mots 'important'
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("important", Color.LightBlue);
// surligner toutes les occurrences séparées de 'the'
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("the", Color.Violet, new TextSearchOptions()
{ WholeWordsOnly = true }, null);
presentation.Save("SomePresentation-out2.pptx", SaveFormat.Pptx);
}
Voir Aussi
- interface ITextSearchOptions
- interface IFindResultCallback
- interface ITextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides