Tank01
Messages postés106Date d'inscriptionlundi 4 août 2003StatutMembreDernière intervention10 novembre 2006
-
8 juin 2006 à 14:05
Tank01
Messages postés106Date d'inscriptionlundi 4 août 2003StatutMembreDernière intervention10 novembre 2006
-
9 juin 2006 à 09:56
Bonjour,
Je souhaitais savoir comment proceder pour imprimer un TImage. Je sais que ma question doit paraitre très bete, certes, mais en essayant:
TImage.picture., on me propose tout sauf quelquechose du genre Print !
Voila, je pense que vous pourrez m'aider facilement!
Tank01
Messages postés106Date d'inscriptionlundi 4 août 2003StatutMembreDernière intervention10 novembre 2006 8 juin 2006 à 14:31
Je comprend la démarche, mais, en fait,je doit créer un nouveaux TBitmap sur ma forme, et mettre du code permettant de recopier mon TImage dans mon TBitmap ?
jlen100
Messages postés1606Date d'inscriptionsamedi 10 juillet 2004StatutMembreDernière intervention25 juillet 201413 8 juin 2006 à 14:40
non le picture du Timage possède une propriété bitmap que tu peux utiliser:
Image1.Picture.Bitmap......
ou pour simplifier l'écriture
with Image1.Picture do //déclaration pour accéder à la propriété begin //ici tu utilises le bitmap comme s'il était directement sur la form
Tank01
Messages postés106Date d'inscriptionlundi 4 août 2003StatutMembreDernière intervention10 novembre 2006 9 juin 2006 à 09:56
Bonjour,
Je te remercie pour ton aide qui ma fais pas mal avancer, mais un petit problème assez génant persiste:
Ma page sors blanche, rien ne s'imprime sur ma feuille ! lol
voici mon petit code
procedure TForm1.BtnPrintClick(Sender: TObject);
var
printDialog : TPrintDialog;
begin
printDialog := TPrintDialog.Create(Form1);
printDialog.MinPage := 1;
printDialog.MaxPage := 1;
printDialog.ToPage := 1;
printDialog.Options := [poPageNums];
PrintDialog.execute;
Printer.BeginDoc();
//ImageHolder.Picture.Bitmap.Canvas.Draw(0,0,BMP); // CE QUE JAI ESSAYER EN PREMIER
Canvas.Draw(0,0,ImageHolder.Picture.Bitmap); // CE QUE JAI ESSAYER EN SECOND
Printer.EndDoc();
end;