''
'' 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 a 3D effect with direct colors to a shape.
Public Class Shape3DDirectColorEffect
Function CreateDocx() As GcWordDocument
Dim doc = New GcWordDocument()
Dim p As Paragraph = doc.Body.Paragraphs.Add()
Dim run As Run = p.GetRange().Runs.Add()
Dim shape As Shape = run.GetRange().Shapes.Add()
shape.Fill.Type = FillType.Solid
shape.Fill.SolidFill.ThemeColor = ThemeColorId.Accent1
Dim shapeFormat = shape.Effects.ThreeDFormat
Dim schemeEffects = doc.Theme.FormatScheme.Effects.Add()
Dim schemeFormat = schemeEffects.ThreeDFormat
Dim schemeScene = schemeEffects.ThreeDScene
''TopBevel
schemeFormat.TopBevel.Type = BevelType.Angle
schemeFormat.TopBevel.Width = 18.5F
schemeFormat.TopBevel.Height = 58.5F
''BottomBevel
schemeFormat.BottomBevel.Type = BevelType.ArtDeco
schemeFormat.BottomBevel.Width = 11.5F
schemeFormat.BottomBevel.Height = 21.5F
''Depth
schemeFormat.Depth.Width = 33.5F
schemeFormat.Depth.Color.ThemeColor = ThemeColorId.Accent3
''Contour
schemeFormat.Contour.Width = 43.5F
schemeFormat.Contour.Color.RGB = Color.Blue
''Material
schemeFormat.Material = MaterialType.Metal
''DistanceFromGround
schemeFormat.DistanceFromGround = 48.5F
''set scene
schemeScene.Camera.Preset = CameraPreset.OrthographicFront
schemeScene.Lighting.Direction = LightRigDirection.Top
schemeScene.Lighting.Type = LightRigType.ThreePoints
shape.Style.Effects.ThemeEffects = schemeEffects
'' Done:
Return doc
End Function
End Class