Shape3DDirectColorEffect.cs
//
// This code is part of Document Solutions for Word demos.
// Copyright (c) MESCIUS inc. All rights reserved.
//
using System;
using System.IO;
using System.Drawing;
using System.Collections.Generic;
using System.Linq;
using GrapeCity.Documents.Word;

namespace DsWordWeb.Demos
{
    // This example shows how to add a 3D effect with direct colors to a shape.
    public class Shape3DDirectColorEffect
    {
        public GcWordDocument CreateDocx()
        {
            var doc = new GcWordDocument();

            Paragraph p = doc.Body.Paragraphs.Add();
            Run run = p.GetRange().Runs.Add();
            Shape shape = run.GetRange().Shapes.Add();
            shape.Fill.Type = FillType.Solid;
            shape.Fill.SolidFill.ThemeColor = ThemeColorId.Accent1;

            var shapeFormat = shape.Effects.ThreeDFormat;

            var schemeEffects = doc.Theme.FormatScheme.Effects.Add();
            var schemeFormat = schemeEffects.ThreeDFormat;
            var schemeScene = schemeEffects.ThreeDScene;
            //TopBevel
            schemeFormat.TopBevel.Type = BevelType.Angle;
            schemeFormat.TopBevel.Width = 18.5f;
            schemeFormat.TopBevel.Height = 058.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;
            //DisnatceFromGround
            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;
        }
    }
}