Board index » cppbuilder » Gloabal Printer and Plotters

Gloabal Printer and Plotters


2005-03-30 10:49:50 AM
cppbuilder20
Hi
I am using the gobal TPrinter* to print a bit map image. When I use my
HP Office Jet color printer it works fine. When I try to print the bit map
image with a HP Designjet 500 plotter and another plotter I don't have the
model off hand, I get a memory error. is there a known problem with
plotters.
 
 

Re:Gloabal Printer and Plotters

Hi William,
What code are you using to print the bitmap? Before troubleshooting
other areas, you should first make sure that you're using a DIB and
StretchDIBits(); see...
graphicsbb.itgo.com/BitmapPrint.html
www.code4sale.com/joehecht/prndib.htm
I've never printed to a plotter before, but you might have to use
banding (i.e., printing the image a strip at a time) to work around the
memory issues.
Good luck,
William Westbrooks wrote:
Quote
I am using the gobal TPrinter* to print a bit map image. When I use my
HP Office Jet color printer it works fine. When I try to print the bit map
image with a HP Designjet 500 plotter and another plotter I don't have the
model off hand, I get a memory error. is there a known problem with
plotters.
 

Re:Gloabal Printer and Plotters

Hi
Here is the code
if (x1/y1>x2/y2) {
// Use Page Width to size the rectangle
MapWindowRect1 = Rect(200, 200, x2 + 200, x2 * y1 / x1 + 200);
} else {
// Use Page Height to size the rectangle
MapWindowRect1 = Rect(200, 200, y2 * x1 / y1 + 200, y2 + 200);
}
Prntr->BeginDoc();
Prntr->Canvas->StretchDraw(MapWindowRect1, MergedBitmap);
Prntr->EndDoc();
"Damon Chandler (TeamB)" < XXXX@XXXXX.COM >
wrote in message news:424a1e1f$ XXXX@XXXXX.COM ...
Quote
Hi William,
What code are you using to print the bitmap? Before troubleshooting
other areas, you should first make sure that you're using a DIB and
StretchDIBits(); see...

graphicsbb.itgo.com/BitmapPrint.html
www.code4sale.com/joehecht/prndib.htm

I've never printed to a plotter before, but you might have to use banding
(i.e., printing the image a strip at a time) to work around the memory
issues.

Good luck,
--
Damon (TeamB)
C++Builder Developer's Journal
bcbjournal.com
BCB Commonly Asked Questions
bcbjournal.com/bcbcaq


William Westbrooks wrote:
>I am using the gobal TPrinter* to print a bit map image. When I use
>my
>HP Office Jet color printer it works fine. When I try to print the bit
>map
>image with a HP Designjet 500 plotter and another plotter I don't have
>the
>model off hand, I get a memory error. is there a known problem with
>plotters.
 

{smallsort}

Re:Gloabal Printer and Plotters

William,
You'll want to use the StretchDIBits() GDI function instead of the
StretchDraw() method. See if the code on the first link I provided
performs any better.
HTH,
William wrote:
Quote
Prntr->BeginDoc();
Prntr->Canvas->StretchDraw(MapWindowRect1, MergedBitmap);
Prntr->EndDoc();