SoftEdgeEffect.vb
''
'' This code is part of Document Solutions for Word demos.
'' Copyright (c) MESCIUS inc. All rights reserved.
''
Imports System.Drawing
Imports GrapeCity.Documents.Word

'' This example shows how to add blur effect to shapes in a DOCX.
Public Class SoftEdgeEffect
    Function CreateDocx() As GcWordDocument
        Dim doc = New GcWordDocument()

        '' Shape Soft Edge - direct:
        Dim p As Paragraph = doc.Body.Paragraphs.Add()
        Dim run As Run = p.GetRange().Runs.Add()
        Dim shape As Shape = run.GetRange().Shapes.Add(100, 100, GeometryType.Star7)
        shape.Fill.Type = FillType.Solid
        shape.Fill.SolidFill.RGB = Color.Yellow
        shape.Line.Width = 8
        shape.Line.Fill.SolidFill.RGB = Color.Red
        '' apply 5 point soft edge effect to the shape
        shape.Effects.SoftEdge.Radius = 5F
        p.GetRange().Runs.Add("Shape Soft Edge - direct.", doc.Styles(BuiltInStyleId.Strong))

        '' Shape Soft Edge - shapes style:
        p = doc.Body.Paragraphs.Add()
        p.Style.ParagraphFormat.Spacing.SpaceBefore = 30
        run = p.GetRange().Runs.Add()
        shape = run.GetRange().Shapes.Add(100, 100, GeometryType.Star7)
        shape.Fill.Type = FillType.Solid
        shape.Fill.SolidFill.RGB = Color.Yellow
        shape.Line.Width = 8
        shape.Line.Fill.SolidFill.RGB = Color.Red
        '' apply 5 point soft edge effect to the style
        Dim fmtEffect = doc.Theme.FormatScheme.Effects.Add()
        fmtEffect.SoftEdge.Radius = 5F
        shape.Style.Effects.ThemeEffects = fmtEffect
        p.GetRange().Runs.Add("Shape Soft Edge - shapes style.", doc.Styles(BuiltInStyleId.Strong))

        '' Done:
        Return doc
    End Function
End Class