Text3DEffect.cs
  1. //
  2. // This code is part of Document Solutions for Word demos.
  3. // Copyright (c) MESCIUS inc. All rights reserved.
  4. //
  5. using System;
  6. using System.IO;
  7. using System.Drawing;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using GrapeCity.Documents.Word;
  11.  
  12. namespace DsWordWeb.Demos
  13. {
  14. // This example shows how to add a 3D effect to a text.
  15. public class Text3DEffect
  16. {
  17. public GcWordDocument CreateDocx()
  18. {
  19. var doc = new GcWordDocument();
  20.  
  21. Paragraph paragraph = doc.Body.Paragraphs.Add();
  22. Run run = paragraph.GetRange().Runs.Add("3D effects");
  23.  
  24. GrapeCity.Documents.Word.Font font = run.Font;
  25. font.Size = 72f;
  26. font.Bold = true;
  27. font.Color.ThemeColor = ThemeColorId.Accent3;
  28. font.Line.Fill.Type = FillType.NoFill;
  29.  
  30. // apply 3D effect
  31. ThreeDFormat threeD = font.Effects.ThreeDFormat;
  32. threeD.Material = MaterialType.Matte;
  33. threeD.Depth.Width = 4.5f;
  34. threeD.TopBevel.Type = BevelType.Angle;
  35. threeD.TopBevel.Width = 5f;
  36. threeD.TopBevel.Height = 1f;
  37.  
  38. // Done:
  39. return doc;
  40. }
  41. }
  42. }
  43.