set RenderingHint for Bilinear Interpolation has no effect at a printer
Graphics2D. E.g:
public int print(Graphics g,PageFormat pf,int pageIndex) {
if (pageIndex == 0) {
BufferedImage bi =
new BufferedImage(2,2,BufferedImage.TYPE_INT_RGB);
bi.setRGB(0,0,0);
bi.setRGB(0,1,0xffffff);
bi.setRGB(1,0,0xffffff);
bi.setRGB(1,1,0);
Graphics2D g2d= (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
g2d.drawImage(bi,
(int) pf.getImageableX(),
(int) pf.getImageableY(),
(int) (pf.getImageableX() + pf.getImageableWidth()),
(int) (pf.getImageableY() + pf.getImageableHeight()),
0, 0, 2, 2, null);
return Printable.PAGE_EXISTS; } else {
return Printable.NO_SUCH_PAGE;
}
}
does NOT print a 2D grayscale, but only a 2x2 black/white chessboard
(=>uses nearest neighbor interpolation).
Is that a lack of Java2D, of my Printer(driver) - or are only my
expectations wrong?
gunter zeilinger
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".