Beispiel #1
0
 public override void Render(BaseRenderer g, float quality = 1, int start = 0, bool simple = false)
 {
     if (Points.Count >= 4 && image != null)
     {
         float x = Points[0].X;
         float y = Points[0].Y;
         float w = Points[2].X - x;
         float h = Points[2].Y - y;
         g.DrawImage(image, new RectangleF(x, y, w, h));
     }
 }
Beispiel #2
0
 public void DrawPDFHQ(BaseRenderer r, int height)
 {
     if (OriginalPage != null)
     {
         string filename = Path.Combine(TmpManager.GetTmpDir().FullName, "tmp.pdf");
         using (PdfDocument doc = new PdfDocument())
         {
             doc.AddPage(OriginalPage);
             doc.Save(filename);
         }
         using (Bitmap bmp = MupdfSharp.PageRenderer.Render(filename, height, new int[] { 0 })[0])
         {
             using (var img = new Renderer.Image(bmp))
             {
                 var sizePx = Format.GetPixelSize();
                 r.DrawImage(img, new RectangleF(0, 0, sizePx.Width, sizePx.Height));
             }
         }
         File.Delete(filename);
     }
 }