regards,
Jan Breukelman.
If you find no answer here, try the Graphics newsgroup.
PhR
Rene
Jan Breukelman wrote:
>
> I've got a problem to print in both portrait and landscape on the same
> page.
Since Windows does not support changing the orientation on a page while
printing (it can only be changed between pages) you will have to do the
coordinate transforms for one of the orientations yourself. That assumes
you have control over the painting code (do not use a 3rd-party
component for it). The standard mapping modes offered by Windows (see
SetMapMode) do not support rotation of the coordinate system. NT,
however, has an enhanced GDI library that supports also rotation as part
of a "world coordinate" system (see SetWorldTransform). I don't know if
that is available with Win98. These kinds of transforms would probably
allow you to rotate output on the page even if it is produced by a
3rd-party component.
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
{ don't forget to use the Printers system class in your uses statement }
procedure Tform1.StartPrinter(Sender:TObject);
var
PrintText : System.Text; // this should be a global variable
initialized in the private
// section of the form
begin
{ Initialize printer system and assign printer }
Printer.Orientation := poLandscape; // or
Printer.Orientation := poPortrait;
AssignPrn(PrintText);
Rewrite(PrintText);
{ Change printer canvas configuration }
Printer.Canvas.Font.Name := 'Courier New';
Printer.Canvas.Font.Size := 7;
end;
I used this to print hard-coded detail reports - I also used
write/writeln's!
Hope it helps!
Maurice
Jan Breukelman <jbr...@casema.net> wrote in message
news:3735B57B...@casema.net...
> I've got a problem to print in both portrait and landscape on the same
> page.
> I'm writing a chart-printing program. but I need to print the results 90
> degrees rotated on the chart.
> Simply changing the orientation won't work.
http://www.borland.com/devsupport/delphi/qanda/FAQ1545D.html
Joe
--
Joe C. Hecht
http://home1.gte.net/joehecht/index.htm
I think think the question was changing it in one page, between two
pictures or printouts. So the top would be portrait, and the bottom
landscape (rotated 90 degrees).
Should be a bit more difficult.
--
Rudy Velthuis
rvel...@gmx.net
http://members.xoom.com/RVelthuis
Rudy Velthuis wrote:
> In article <373770...@gte.net>, Joe C. Hecht wrote...
> >I think I did a FAQ about changing the page orientation
> >between pages.
> >
> >http://www.borland.com/devsupport/delphi/qanda/FAQ1545D.html
>
> I think think the question was changing it in one page, between two
> pictures or printouts. So the top would be portrait, and the bottom
> landscape (rotated 90 degrees).
>
> Should be a bit more difficult.
Yes, that's exactly what I want.
To come back to the part Peter Below wrote: "Windows'95 DOES support
both portrait and landscape on one page."
It is only the way you give that part to windows back.
I have tried to create a bitmap(on a screen-canvas) and rotate that one.
It works fine, when I was only using the screen, but when I use the same
technique to get in on the printer-canvas, the text is almost invisible.
cause the resolution of the screen and the printer differ.
So at this moment the queston is more like :
"How can I create a bitmap using the printer-resolution and put some
text on it the right resolution , so I can rotate it and than copy it to
the printer-canvas"
You can output the bitmap using StretchDIBits, that allows you to enlarge
it to a sensible size for the printer. However, if you need to print
rotated text there is an easier way: if you use truetype fonts you can
create a rotated font and use that to directly output to the printer
canvas, without any memory-intensive bitmap in between. Here is a simple
example:
procedure TForm1.Button3Click(Sender: TObject);
var
lf: TLogfont;
begin
with printer do begin
begindoc;
canvas.font.Name := 'Arial';
canvas.font.Size := 24;
canvas.textout( 100, 100, 'Das ist normaler Text' );
GetObject( canvas.font.handle, Sizeof(lf), @lf);
lf.lfescapement := 450;
lf.lforientation := 450;
Canvas.Font.handle := CreateFontIndirect( lf );
canvas.TextOut( 100, 1500, 'Das ist gedrehter Text');
EndDoc;
end;
end;
"Peter Below (TeamB)" wrote:
Thanx Peter,
This was Exactly what I was looking for.
Greetings Jan Breukelman.
You quoted Peter's entire message to post a one-line response. Remember to
trim your quotes, as requested by the newsgroup guidelines: "When quoting a
previous post, edit out the non-relevant parts of the message. A good rule
of thumb is that there should not be more quoted text than original text."
- Rick