''
'' 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 BlurEffect
Function CreateDocx() As GcWordDocument
Dim doc = New GcWordDocument()
'' Shape Blur - 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.Star4)
shape.Fill.Type = FillType.Solid
shape.Fill.SolidFill.RGB = Color.Yellow
shape.Line.Width = 4
shape.Line.Fill.SolidFill.RGB = Color.Red
'' apply 7 point blur effect to the shape
shape.Effects.Blur.Radius = 7F
p.GetRange().Runs.Add("Shape Blur - direct.", doc.Styles(BuiltInStyleId.Strong))
'' Shape Blur - 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.Star4)
shape.Fill.Type = FillType.Solid
shape.Fill.SolidFill.RGB = Color.Yellow
shape.Line.Width = 4
shape.Line.Fill.SolidFill.RGB = Color.Red
'' apply 7 point blur effect to the shape
Dim fmtEffect = doc.Theme.FormatScheme.Effects.Add()
fmtEffect.Blur.Radius = 7F
shape.Style.Effects.ThemeEffects = fmtEffect
p.GetRange().Runs.Add("Shape Blur - shapes style.", doc.Styles(BuiltInStyleId.Strong))
'' Done:
Return doc
End Function
End Class