Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing large bitmap with DELPHI 1/ NT4

Posted on 1997-12-18
6
Medium Priority
?
381 Views
Last Modified: 2010-04-04
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
Comment
Question by:lgc5800
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Expert Comment

by:d003303
ID: 1354129
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
 
LVL 8

Expert Comment

by:ZifNab
ID: 1354130
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
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1354131
Does the error occures when you print with APIs?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:Odie
ID: 1354132
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
 
LVL 1

Accepted Solution

by:
Odie earned 400 total points
ID: 1354133
Hope it helped
0
 

Expert Comment

by:kruglov
ID: 1354134
from Delphi.HLP:
....some printers do not support graphics. Therefore, the Draw, StretchDraw, or CopyRect methods might fail on these printers.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question