RelativeSizeExamples.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 RelativeSizeExamples
  9. {
  10. [Test]
  11. public void ItemTypes()
  12. {
  13. RenderingTest
  14. .Create()
  15. .ProduceImages()
  16. .PageSize(600, 600)
  17. .ShowResults()
  18. .Render(container =>
  19. {
  20. container
  21. .AlignMiddle()
  22. .AlignCenter()
  23. .Width(400)
  24. .Height(400)
  25. .Background(Colors.Grey.Lighten2)
  26. .AlignMiddle()
  27. .AlignCenter()
  28. .Container()
  29. .AlignMiddle()
  30. .AlignCenter()
  31. .RelativeWidth(0.25f)
  32. .RelativeHeight(0.5f)
  33. .Background(Colors.Grey.Darken2);
  34. });
  35. }
  36. }
  37. }