public void Render_Graphics(int id, string filename, int pagenum, int width, int height, RenderOption options) { using (var src = new DocumentRenderer(GetSource(filename))) using (var bmp = new Bitmap(width, height)) using (var gs = Graphics.FromImage(bmp)) { src.RenderOption = options; src.Render(gs, src.GetPage(pagenum)); bmp.Save(Get($"{nameof(Render_Graphics)}-{id:D3}.png"), ImageFormat.Png); } }
public void Render(int id, string filename, int pagenum, int width, int height, RenderOption options) { using (var src = new DocumentRenderer(GetSource(filename))) { src.RenderOption = options; using (var bmp = src.Render(src.GetPage(pagenum))) { Assert.That(bmp.Width, Is.EqualTo(width)); Assert.That(bmp.Height, Is.EqualTo(height)); bmp.Save(Get($"{nameof(Render)}-{id:D3}.png"), ImageFormat.Png); } } }