Aspose::Words::Drawing::GlowFormat::get_Transparency method

GlowFormat::get_Transparency method

Gets or sets the degree of transparency for the glow effect as a value between 0.0 (opaque) and 1.0 (clear). The default value is 0.0.

double Aspose::Words::Drawing::GlowFormat::get_Transparency()

Examples

Shows how to interact with glow shape effect.

auto doc = System::MakeObject<Aspose::Words::Document>(System::String(get_MyDir() + u"Various shapes.docx"));
auto shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(NodeType::Shape, 0, true));

shape->get_Glow()->set_Color(System::Drawing::Color::get_Salmon());
shape->get_Glow()->set_Radius(30);
shape->get_Glow()->set_Transparency(0.15);

doc->Save(get_ArtifactsDir() + u"Shape.Glow.docx");

doc = System::MakeObject<Aspose::Words::Document>(System::String(get_ArtifactsDir() + u"Shape.Glow.docx"));
shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(NodeType::Shape, 0, true));

ASSERT_EQ(shape->get_Glow()->get_Color().ToArgb(), System::Drawing::Color::FromArgb(217, 250, 128, 114).ToArgb());
ASPOSE_ASSERT_EQ(shape->get_Glow()->get_Radius(), 30);
ASSERT_NEAR(shape->get_Glow()->get_Transparency(), 0.15, 0.01);

shape->get_Glow()->Remove();

ASSERT_EQ(shape->get_Glow()->get_Color().ToArgb(), System::Drawing::Color::get_Black().ToArgb());
ASPOSE_ASSERT_EQ(shape->get_Glow()->get_Radius(), 0);
ASPOSE_ASSERT_EQ(shape->get_Glow()->get_Transparency(), 0);

See Also