()
| 565 | } |
| 566 | |
| 567 | protected void render() { |
| 568 | if (bbox == null) |
| 569 | return; |
| 570 | |
| 571 | float width = bbox.x1 - bbox.x0; |
| 572 | float height = bbox.y1 - bbox.y0; |
| 573 | float scaleX = (float) Math.floor(width * (currentDPI/72.0f) * pixelScale + 0.5f) / width; |
| 574 | float scaleY = (float) Math.floor(height * (currentDPI/72.0f) * pixelScale + 0.5f) / height; |
| 575 | Matrix ctm = new Matrix().scale(scaleX, scaleY).rotate(rotate); |
| 576 | |
| 577 | Rect atOrigin = new Rect(bbox).transform(ctm); |
| 578 | ctm.e -= atOrigin.x0; |
| 579 | ctm.f -= atOrigin.y0; |
| 580 | Rect bounds = new Rect(bbox).transform(ctm); |
| 581 | |
| 582 | Cookie cookie = new Cookie(); |
| 583 | |
| 584 | renderMeter = new RenderProgressmeter(this, "Rendering...", cookie, 250); |
| 585 | renderMeter.setLocationRelativeTo(this); |
| 586 | pageCanvas.requestFocusInWindow(); |
| 587 | |
| 588 | doc.renderPage(ctm, bounds, icc, antialias, invert, tint, tintBlack, tintWhite, cookie, |
| 589 | new ViewerCore.OnException() { |
| 590 | public void run(Throwable t) { |
| 591 | if (!renderMeter.cancelled) |
| 592 | exception(t); |
| 593 | } |
| 594 | } |
| 595 | ); |
| 596 | } |
| 597 | |
| 598 | protected int findExactZoomLevel(int dpi) { |
| 599 | for (int level = 0; level < zoomList.length - 1; level++) |
no test coverage detected