Delphi 6
Bonjour,
Une bitmap s'affiche correctement à l'écran (dans le canvas d'une fiche), mais est illisible à l'impression (canvas de l'objet Printer). Je ne comprends pas pourquoi.
C'est pourtant assez basic comme manip !
Voici le résultat.
Ci après, le code qui a permis cet essai
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
19
20
21
22
23
24
25
26
27 procedure TForm1.FormCreate(Sender: TObject); begin Bitmap := TBitmap.Create; Bitmap.LoadFromFile('C:\Program Files\Fichiers communs\Borland Shared\Images\Splash\256Color\factory.bmp'); end; procedure TForm1.Button1Click(Sender: TObject); begin try Form1.Canvas.Draw(50,50,BitMap); // dessin sur la fiche ==> ok with Printer do begin BeginDoc; Canvas.Draw(50,50,BitMap); // dessin sur l'imprimante ==> ko EndDoc; end; finally end; end; procedure TForm1.FormDestroy(Sender: TObject); begin Bitmap.Free; end;
Partager