Board index » delphi » Pixels doesn't work printing landscape

Pixels doesn't work printing landscape

Hi,

I need to use the Pixels property with the Printer Canvas, but, using
the code below, I get nothing when I try to print it with a landscape
orientation.

===
  Printer.Orientation := poLandscape; // or poPortrait

  Printer.BeginDoc;

  Printer.Canvas.MoveTo(500, 500);   // works anyway
  Printer.Canvas.LineTo(1500, 500);

  for i := 0 to 1000 do
    Printer.Canvas.Pixels[500+i,800] := clBlack;  // works only with
poPortrait

  Printer.EndDoc;
===

Could anyone tell me why?

Thanks in advance
--

Luis Fernando Nacif Rocha
lfna...@bhnet.com.br - Brazil

"Grandes e admiraveis sao as tuas obras, Senhor Deus, Todo-Poderoso!
Justos e verdadeiros sao os teus caminhos, oh Rei das nacoes!" Ap 15:3

"Great and marvelous are your deeds, Lord God Almighty.
Just and true are your ways, King of the ages." Rev. 15:3

 

Re:Pixels doesn't work printing landscape


"Luis Fernando Nacif Rocha" <lfna...@bhnet.com.br> wrote in message
news:38907074.D78288FA@bhnet.com.br...

Quote
> I need to use the Pixels property with the Printer Canvas, but, using
> the code below, I get nothing when I try to print it with a landscape
> orientation.

Even if Pixels worked, this will be very, very slow.  Create an in-memory
TBitmap and use Scanline to change the pixel data.
http://www.efg2.com/Lab/ImageProcessing/Scanline.htm

Then use StretchDIBits to print the TBitmap.  See Item #1 at:
http://www.efg2.com/Lab/Library/Delphi/Printing

--
efg

Earl F. Glynn     E-Mail:  EarlGl...@att.net
Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab

Other Threads