Solved

Printing large bitmap with DELPHI 1/ NT4

Posted on 1997-12-18
6
374 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now