Solved

Printing large bitmap with DELPHI 1/ NT4

Posted on 1997-12-18
6
378 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
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 67
Delphi: Connect to running MS Outlook 4 120
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 71
Delphi android app hide keyboard 3 13
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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