RelativePositionExamples.cs 905 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Linq;
  2. using NUnit.Framework;
  3. using QuestPDF.Examples.Engine;
  4. using QuestPDF.Fluent;
  5. using QuestPDF.Helpers;
  6. namespace QuestPDF.Examples
  7. {
  8. public class RelativePositionExamples
  9. {
  10. [Test]
  11. public void ItemTypes()
  12. {
  13. RenderingTest
  14. .Create()
  15. .ProduceImages()
  16. .PageSize(500, 500)
  17. .ShowResults()
  18. .Render(container =>
  19. {
  20. container
  21. .Padding(100)
  22. .Background(Colors.Grey.Lighten2)
  23. .RelativePositionVertical(0.5f, -0.5f)
  24. .RelativePositionHorizontal(1f, -0.5f)
  25. .RelativeWidth(0.4f)
  26. .RelativeHeight(0.6f)
  27. .Background(Colors.Grey.Darken2);
  28. });
  29. }
  30. }
  31. }