Adicionar efeito de brilho

Adicionando efeito de brilho ao texto

Applying a glow effect to text in IronWord is accomplished by configuring the TextEffect property of a TextStyle object. O efeito de brilho cria uma borda luminosa ao redor do texto, com propriedades de cor e raio personalizáveis ​​para controlar a aparência visual.

To create a glow effect, instantiate a TextStyle and assign a TextEffect object with a configured Glow instance. The Glow object accepts properties like GlowColor to specify the color of the glow and GlowRadius to control the spread of the effect. Valores de raio maiores produzem brilhos mais difusos, enquanto valores menores criam halos mais concentrados ao redor do texto.

After configuring the text style, create a Run object containing the desired TextContent and assign the configured style to the Run. Use AddChild to add the styled run to a paragraph, then add the paragraph to the document. Isso segue a hierarquia do documento: Documento → Parágrafo → Execução → Conteúdo do Texto.

Explicação do código

O trecho de código acima demonstra como criar um novo documento do Word e aplicar um estilo de texto com efeito de brilho. First, a new Word document is instantiated and stored in the variable doc. Then, a new TextStyle object named textStyle is created. This text style is configured to include a glow effect by initializing a TextEffect object with specific settings.

To add the styled text with the glow effect, a Paragraph is created, then a Run object is created containing TextContent with "Hello World". The textStyle is assigned to the Run, which applies the glow effect. The Run is added to the Paragraph using AddChild, and finally the Paragraph is added to the document. Essa abordagem em várias etapas segue a hierarquia do documento: Documento → Parágrafo → Execução → Conteúdo do Texto. Por fim, o documento do Word é exportado como um novo arquivo.

Para mais exemplos e demonstrações, acesse o seguinte artigo: Como adicionar efeito de brilho ao texto .

Saiba mais sobre os elementos do documento no IronWord.

Pronto para começar?
Nuget Downloads 35,581 | Versão: 2026.3 acaba de ser lançado
Still Scrolling Icon

Ainda está rolando a tela?

Quer provas rápidas? PM > Install-Package IronWord
executar um exemplo Veja seus dados se transformarem em um documento do Word.