Cómo Añadir Efecto de Resplandor al Texto en C#

How to Add Glow Effect to Text

This article was translated from English: Does it need improvement?
Translated
View the article in English

The glow effect on text is a visual effect that creates a glowing aura around the characters. This effect makes the text appear as if it is emitting light, creating a soft, luminous outline that can enhance readability and draw attention.

Quickstart: Apply Glow Effect to a Text Element Fast

Just instantiate a Glow object, set its radius and color, embed it in a TextEffect, and assign it to your text’s style. In one short line you’ll see glowing text in your Word document.

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronWord with NuGet Package Manager

    PM > Install-Package IronWord

  2. Copy and run this code snippet.

    someTextElement.Style.TextEffect = new IronWord.Models.TextEffect { GlowEffect = new IronWord.Models.Glow { GlowRadius = 8, GlowColor = System.Drawing.Color.FromArgb(180, 0, 128, 255) } };
  3. Deploy to test on your live environment

    Start using IronWord in your project today with a free trial
    arrow pointer

Get Started with IronWord

Comience a usar IronWord en su proyecto hoy con una prueba gratuita.

Primer Paso:
green arrow pointer

Add Glow Effect

To specify the glow effect for the text, you can start by creating and configuring the Glow object. Then, create the TextEffect object from this Glow object. Finally, assign the TextEffect to the TextEffect property of the text.

using IronWord; // Import the necessary library

public class TextGlowEffectExample
{
    public void ApplyGlowEffect()
    {
        // Initialize a new Glow object
        Glow glow = new Glow();

        // Set the properties for the glow effect
        glow.GlowRadius = 5; // Radius of the glow effect
        glow.GlowColor = System.Drawing.Color.FromArgb(128, 255, 0, 0); // ARGB value for the glow color

        // Create a TextEffect object and assign the glow effect to it
        TextEffect textEffect = new TextEffect();
        textEffect.Glow = glow;

        // Apply the TextEffect to the text
        // Example: someTextElement.TextEffect = textEffect;

        // Further code to export or display the document would go here
    }
}
using IronWord; // Import the necessary library

public class TextGlowEffectExample
{
    public void ApplyGlowEffect()
    {
        // Initialize a new Glow object
        Glow glow = new Glow();

        // Set the properties for the glow effect
        glow.GlowRadius = 5; // Radius of the glow effect
        glow.GlowColor = System.Drawing.Color.FromArgb(128, 255, 0, 0); // ARGB value for the glow color

        // Create a TextEffect object and assign the glow effect to it
        TextEffect textEffect = new TextEffect();
        textEffect.Glow = glow;

        // Apply the TextEffect to the text
        // Example: someTextElement.TextEffect = textEffect;

        // Further code to export or display the document would go here
    }
}
Imports IronWord ' Import the necessary library

Public Class TextGlowEffectExample
	Public Sub ApplyGlowEffect()
		' Initialize a new Glow object
		Dim glow As New Glow()

		' Set the properties for the glow effect
		glow.GlowRadius = 5 ' Radius of the glow effect
		glow.GlowColor = System.Drawing.Color.FromArgb(128, 255, 0, 0) ' ARGB value for the glow color

		' Create a TextEffect object and assign the glow effect to it
		Dim textEffect As New TextEffect()
		textEffect.Glow = glow

		' Apply the TextEffect to the text
		' Example: someTextElement.TextEffect = textEffect;

		' Further code to export or display the document would go here
	End Sub
End Class
$vbLabelText   $csharpLabel
Add glow effect

Glow Effect Properties

Below are all the glow effect properties and their descriptions:

  • GlowRadius: Gets or sets the radius of the glow effect. The glow radius is specified in points (1/72 inch).
  • GlowColor: Gets or sets the color of the glow effect.

Glow Effect Examples

Let's look at some more glow effect examples. The color of the glow effect can also accept ARGB values. The first value is alpha, which describes how opaque the color is.

Glow effect examples

Preguntas Frecuentes

¿Cómo puedo agregar un efecto de brillo al texto en un documento de Word?

Para agregar un efecto de brillo al texto en un documento de Word, utiliza una biblioteca de C# diseñada para este propósito. Inicializa un objeto Glow, configura sus propiedades como GlowRadius y GlowColor, y asígnalo a un objeto TextEffect. Finalmente, aplica este TextEffect a tu texto y exporta el documento.

¿Qué código se necesita para aplicar un efecto de brillo al texto usando C#?

Puedes aplicar un efecto de brillo importando la biblioteca necesaria y creando un objeto Glow con las propiedades deseadas. Asigna esto a un objeto TextEffect y aplícalo a tu texto.

¿Cuáles son las propiedades clave del efecto de brillo en la edición de texto?

Las propiedades clave del efecto de brillo son GlowRadius, que establece el radio del brillo en puntos, y GlowColor, que define el color del brillo. Estas propiedades se pueden configurar para personalizar la apariencia del efecto de brillo.

¿Puede personalizarse el color del brillo utilizando valores ARGB?

Sí, el color del brillo puede personalizarse usando valores ARGB. El valor alfa en ARGB determina la opacidad del brillo, permitiendo una amplia gama de personalización de colores.

¿Cómo exporto un documento de Word después de aplicar un efecto de brillo?

Después de aplicar el efecto de brillo usando la biblioteca de C#, exporta el documento de Word editado llamando a los métodos apropiados proporcionados por la biblioteca para guardar o mostrar el documento como un nuevo archivo.

¿Es posible aplicar un efecto de brillo tanto a texto nuevo como existente?

Sí, puedes aplicar el efecto de brillo tanto a texto recién creado como a texto existente dentro de un documento de Word. Esta flexibilidad permite la mejora de cualquier elemento de texto en tu documento.

¿Cuál es el propósito de la propiedad GlowRadius?

La propiedad GlowRadius especifica el radio del efecto de brillo en puntos, ayudando a determinar qué tan lejos se extiende el brillo desde el texto. El radio se define en puntos, donde 1 punto equivale a 1/72 de pulgada.

¿Qué pasos son necesarios para configurar un efecto de brillo en C#?

Para configurar un efecto de brillo en C#, inicializa un objeto Glow, establece sus propiedades GlowRadius y GlowColor, y asígnalo a un objeto TextEffect. Aplica el TextEffect a tu texto y exporta el documento para ver los cambios.

Curtis Chau
Escritor Técnico

Curtis Chau tiene una licenciatura en Ciencias de la Computación (Carleton University) y se especializa en el desarrollo front-end con experiencia en Node.js, TypeScript, JavaScript y React. Apasionado por crear interfaces de usuario intuitivas y estéticamente agradables, disfruta trabajando con frameworks modernos y creando manuales bien ...

Leer más
¿Listo para empezar?
Nuget Descargas 25,807 | Versión: 2025.11 recién lanzado