Bonjour,
J'ai un problème avec la méthode drawImage() que je l'appelle dans une méthode print pour l'impression d'un panneau dessiné avec le graphics 2D.
voila ma méthode:
Mon IDE mon signale un erreur au niveau de ligne de drawImage(). merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException { // Par défaut, retourne NO_SUCH_PAGE => la page nexiste pas int retValue = Printable.NO_SUCH_PAGE; switch(pageIndex){ case 0 : { .......... Faire_Bouton f=new Faire_Bouton(); Image image=f.readImage("logo2.png"); g.drawImage(image, 25, 0,this); g.drawRect(20, 2, 240, 70); ............... retValue = Printable.PAGE_EXISTS; break; } } return retValue; }
Partager