Ce code te permet d'imprimer l'image de ta form en prenant le maximum de place sur la feuille (détection automatique de l'impression paysage ou portrait), tout en gardant les proportions :
procedure TForm1.Button1Click(Sender: TObject);
var
FormImage: TBitmap;
AspectRatio: Single;
OutputWidth, OutputHeight: Single;
begin
// Capture de l'image de la form
FormImage := GetFormImage;
// On définit l'orientation la mieux adaptée. Si c'est un carré, on choisit poLandscape
Printer.Orientation := poLandscape;
If FormImage.Height > FormImage.Width then Printer.Orientation := poPortrait;
// Titre vu dans le gestionnaire d'impression
Printer.Title := 'Impression de l''image de la form';
// On veut qu'une feuille s'imprime
Printer.Copies := 1;
// Début du document
Printer.BeginDoc;
try
// On prend le plus de place possible sur la feuille, tout en gardant les proportions
OutputWidth := FormImage.Width;
OutputHeight := FormImage.Height;
AspectRatio := OutputWidth / OutputHeight;
if (OutputWidth < Printer.PageWidth) and (OutputHeight < Printer.PageHeight) then
begin
if OutputWidth < OutputHeight then
begin
OutputHeight := Printer.PageHeight;
OutputWidth := OutputHeight * AspectRatio;
end
else
begin
OutputWidth := Printer.PageWidth;
OutputHeight := OutputWidth / AspectRatio;
end
end;
if OutputWidth > Printer.PageWidth then
begin
OutputWidth := Printer.PageWidth;
OutputHeight := OutputWidth / AspectRatio;
end;
if OutputHeight > Printer.PageHeight then
begin
OutputHeight := Printer.PageHeight;
OutputWidth := OutputHeight * AspectRatio;
end;
// On dessine l'image de la form sur le canvas de l'imprimante
Printer.Canvas.StretchDraw(Rect(0,0,Trunc(OutputWidth),Trunc(OutputHeight)),FormImage);
finally
// On démarre l'impression
Printer.EndDoc;
// On libère FormImage
FormImage.Free;
end;
end;
J'espère que ça t'ira 
@+
Bonne Prog'
Nico
N'oubliez pas de cliquer sur
Réponse acceptée lorsque la réponse vous convient ! ![]()