HighlightText
Contenido
[
Ocultar
]HighlightText(string, Color)
Resalta todas las coincidencias del texto de muestra con el color especificado.
public void HighlightText(string text, Color highlightColor)
Parámetro | Tipo | Descripción |
---|---|---|
text | String | Texto de muestra para resaltar. |
highlightColor | Color | El color para resaltar el texto. |
Ver También
- class TextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides
HighlightText(string, Color, ITextSearchOptions, IFindResultCallback)
Resalta todas las coincidencias del texto de muestra con el color especificado.
public void HighlightText(string text, Color highlightColor, ITextSearchOptions options,
IFindResultCallback callback)
Parámetro | Tipo | Descripción |
---|---|---|
text | String | El texto a resaltar. |
highlightColor | Color | El color para resaltar el texto. |
options | ITextSearchOptions | Opciones de búsqueda de texto ITextSearchOptions . |
callback | IFindResultCallback | El objeto de retorno para recibir resultados de búsqueda IFindResultCallback . |
Ejemplos
El siguiente ejemplo de código muestra cómo resaltar texto en un TextFrame.
[C#]
using (Presentation presentation = new Presentation("SomePresentation.pptx"))
{
// resaltando todas las palabras 'importante'
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("important", Color.LightBlue);
// resaltando todas las ocurrencias separadas de 'el'
((AutoShape)presentation.Slides[0].Shapes[0]).TextFrame.HighlightText("the", Color.Violet, new TextSearchOptions()
{ WholeWordsOnly = true }, null);
presentation.Save("SomePresentation-out2.pptx", SaveFormat.Pptx);
}
Ver También
- interface ITextSearchOptions
- interface IFindResultCallback
- class TextFrame
- namespace Aspose.Slides
- assembly Aspose.Slides