Bonjour,
pour une applet, j'essaie de dessiner une image en lui donnant une rotation.
Si l'intérieur de l'image est lisse, les bords sont crénelés (bordure noire arrondie aux bords). J'ai essayé tous les paramère de RenderingHint, rien n'y fait. Je cherche donc un moyen de rendre mes images avec un bord lisse.
Ce code étant pour une applet, il serait mieux qu'il tourne sans devoir ajouter de librairie.

Merci par avance,
FL

Contenu de la méthode paint
note : at est une instance de AffineTransform, io l'image observer, angle l'angle de rotation
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
Graphics2D g2d = (Graphics2D)g;
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);		g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
g2d.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE);
g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
at.setToIdentity();
at.rotate(angle);
g2d.drawImage([image], at, io);