Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

Printing large bitmap with DELPHI 1/ NT4

I have a serious problem on DELPHI 1 on NT4 pack 3 with the command :
PRINTER.CANVAS.STRECHDRAW for a large bitmap.
Nothing is printing (9 / 10 tentatives) !



arect := rect(0,0,p1,p2); {p1 = 4000 and p2 = 3250}
with printer do
     begin
     begindoc;
   printer.canvas.stretchdraw(arect,image1.picture.graphic);
     enddoc;
     end;


This print is received by the printer manager (normally +- 700Kb)when printing is OK.
But when no print occurs, the size of the file is anormally little (approximatively 70Kb ?) an nothing is printed.

What append ?

Please HELP me.
Eric
sncb.cim.fl@skynet.be
0
lgc5800
Asked:
lgc5800
1 Solution
 
d003303Commented:
Yo,

try to print to a file and have a look at the output when the printing fails. This may help you finding the error.

Slash/d003303
0
 
ZifNabCommented:
Hi lgc5800,

Try it with this code and look what happens :

procedure TForm1.Button1Click(Sender: TObject);
var
  ScaleX, ScaleY: Integer;
  R: TRect;
begin
  Printer.BeginDoc;  // **
  with Printer do
  try
    ScaleX := GetDeviceCaps(Handle, logPixelsX) div PixelsPerInch;
    ScaleY := GetDeviceCaps(Handle, logPixelsY) div PixelsPerInch;
    R := Rect(0, 0, Image1.Picture.Width * ScaleX,
      Image1.Picture.Height * ScaleY);
    Canvas.StretchDraw(R, Image1.Picture.Graphic);  // **
  finally
    EndDoc;  // **
  end;
end;

c.u. Zif;
0
 
MikeP090797Commented:
Does the error occures when you print with APIs?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
OdieCommented:
Have you read the readme file?  I believe I had the same problem some time back - but I didn't read the readme file and it was explained there.
0
 
OdieCommented:
Hope it helped
0
 
kruglovCommented:
from Delphi.HLP:
....some printers do not support graphics. Therefore, the Draw, StretchDraw, or CopyRect methods might fail on these printers.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now