public void SetClippingRectangle() { var doc = new PortableDocument(); doc.AddPage(200, 200); doc.SetColor(OxyColors.Blue); doc.SetFillColor(OxyColors.LightBlue); doc.SaveState(); doc.SetClippingRectangle(5, 5, 50, 50); doc.DrawCircle(100, 100, 95, true); doc.RestoreState(); doc.DrawCircle(120, 120, 70); doc.Save(Folder + "SetClippingRectangle.pdf"); }
public void RotateAt() { var doc = new PortableDocument(); doc.AddPage(200, 200); doc.SaveState(); doc.SetColor(1, 0, 0); doc.RotateAt(50, 20, 30); doc.DrawRectangle(50, 20, 100, 15); doc.RestoreState(); doc.DrawRectangle(50, 20, 100, 15); doc.Save(Folder + "RotateAt.pdf"); }
public void Translate() { var doc = new PortableDocument(); doc.AddPage(200, 200); doc.SaveState(); doc.SetColor(1, 0, 0); doc.Translate(20, 10); doc.DrawRectangle(10, 10, 100, 70); doc.RestoreState(); doc.DrawRectangle(10, 10, 100, 70); doc.Save(Folder + "Translate.pdf"); }
public void DrawText_Rotated() { var doc = new PortableDocument(); doc.AddPage(200, 200); doc.SetFont("Arial", 12); for (int i = 0; i <= 360; i += 30) { doc.SaveState(); doc.RotateAt(100, 100, i); doc.DrawText(100, 100, "Hello world!"); doc.RestoreState(); } doc.Save(Folder + "DrawText_Rotated.pdf"); }
public void DrawText_Rotated2() { var doc = new PortableDocument(); doc.AddPage(200, 200); doc.SetFont("Arial", 12); for (int i = 0; i <= 360; i += 30) { doc.SaveState(); doc.Translate(100, 100); doc.Rotate(i); doc.DrawText(0, 0, "Hello world!"); doc.RestoreState(); } doc.Save(Folder + "DrawText_Rotated2.pdf"); }