Shape3DPresetEffect.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 preset 3D effect to a shape.
  15. public class Shape3DPresetEffect
  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();
  23. Shape shape = run.GetRange().Shapes.Add(200, 200, GeometryType.Rectangle);
  24. shape.Fill.Type = FillType.Solid;
  25. shape.Fill.SolidFill.ThemeColor = ThemeColorId.Accent1;
  26.  
  27. // apply preset shape effects
  28. shape.ApplyEffectsPreset(ShapeEffectsPreset.Preset10);
  29.  
  30. // Done:
  31. return doc;
  32. }
  33. }
  34. }
  35.