HighlightText
Contenu
[
Cacher
]HighlightText(string, Color)
Surligne 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 | Échantillon de texte à surligner. |
| highlightColor | Color | La couleur pour surligner le texte. |
Voir Aussi
- class TextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides
HighlightText(string, Color, ITextSearchOptions, IFindResultCallback)
Surligne 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
Le 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 'le'
((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
- class TextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides