Shape3DPlaceholderColorEffect.vb
C# VB
'''' This code is part of Document Solutions for Word demos.'' Copyright (c) MESCIUS inc. All rights reserved.''Imports GrapeCity.Documents.Word
'' This example shows how to add a 3D effect with placeholder colors to a shape.Public Class Shape3DPlaceholderColorEffect 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.Accent1 ''Contour schemeFormat.Contour.Width = 43.5F ''color will be retrieved from placeholder. schemeFormat.Contour.Color.ThemeColor = ThemeColorId.None ''Material schemeFormat.Material = MaterialType.Clear ''DistanceFromGround schemeFormat.DistanceFromGround = 48.5F
''set scene schemeScene.Camera.Preset = CameraPreset.OrthographicFront schemeScene.Lighting.Direction = LightRigDirection.Top schemeScene.Lighting.Type = LightRigType.ThreePoints
''set placeholder color shape.Style.Effects.PlaceholderColor.ThemeColor = ThemeColorId.Accent6
shape.Style.Effects.ThemeEffects = schemeEffects
'' Done: Return doc End FunctionEnd Class