''
'' 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 to a shape.
Public Class Shapes3DEffect
Function CreateDocx() As GcWordDocument
Dim doc = New GcWordDocument()
Dim paragraph As Paragraph = doc.Body.Paragraphs.Add()
Dim run As Run = paragraph.GetRange().Runs.Add()
Dim shape As Shape = run.GetRange().Shapes.Add(200, 200, GeometryType.Rectangle)
shape.Fill.Type = FillType.Solid
shape.Fill.SolidFill.ThemeColor = ThemeColorId.Accent1
'' apply 3D format
Dim threeD As ThreeDFormat = shape.Effects.ThreeDFormat
threeD.TopBevel.ApplyPreset(BevelType.Convex)
threeD.Contour.Color.ThemeColor = ThemeColorId.Accent2
threeD.Contour.Width = 3F
threeD.Contour.Color.ThemeColor = ThemeColorId.Accent6
threeD.Contour.Width = 12F
'' apply 3D scene
Dim scene As ThreeDScene = shape.Effects.ThreeDScene
scene.Camera.Preset = CameraPreset.PerspectiveContrastingRightFacing
scene.Lighting.Type = LightRigType.BrightRoom
scene.Lighting.Rotation.Latitude = 90F
scene.Lighting.Rotation.Revolution = 5F
'' Done:
Return doc
End Function
End Class