HighlightRegex()
Contents
[
Hide
]IPresentation::HighlightRegex(System::SharedPtr<System::Text::RegularExpressions::Regex>, System::Drawing::Color, System::SharedPtr<IFindResultCallback>) method
Highlights all matches of the regular expression with the specified color.
virtual void Aspose::Slides::IPresentation::HighlightRegex(System::SharedPtr<System::Text::RegularExpressions::Regex> regex, System::Drawing::Color highlightColor, System::SharedPtr<IFindResultCallback> callback)=0
Arguments
Parameter | Type | Description |
---|---|---|
regex | System::SharedPtr<System::Text::RegularExpressions::Regex> | The regular expression System::Text::RegularExpressions::Regex to get strings to highlight. |
highlightColor | System::Drawing::Color | The color to highlight the text. |
callback | System::SharedPtr<IFindResultCallback> | The callback object for receiving search results IFindResultCallback. |
Remarks
The following code sample shows how to highlight text in a PowerPoint Presentation using a regular expression.
auto presentation = System::MakeObject<Presentation>(u"SomePresentation.pptx");
auto regex = System::MakeObject<System::Text::RegularExpressions::Regex>(u"\\b[^\\s]{10,}\\b");
// highlighting all words with 10 or more characters
presentation->HighlightRegex(regex, System::Drawing::Color::get_Blue(), nullptr);
presentation->Save(u"SomePresentation-out.pptx", SaveFormat::Pptx);
See Also
- Typedef SharedPtr
- Class Regex
- Class Color
- Class IFindResultCallback
- Class IPresentation
- Namespace Aspose::Slides
- Library Aspose.Slides