Solved

Delphi Programming question

Posted on 1997-07-09
1
163 Views
Last Modified: 2010-04-06
OK heres the problem. Once upon a time I was using the
StretchDraw Method to copy a bitmap from a TImage to the
Printer Canvas. The image would print only sometimes.
So I used a DIB to fix the problem, and used the following
code:

CBRDIB := TDIB.Create; (I have a 3rd party DIB dcu)
CBRDIB.Assign(CBRPlotArea.Picture.Bitmap);
InfoHd.bmiHeader := CBRDIB.Header^;
StretchDIBits(ACanvas.Handle,Round(Fac*100),Round(Fac*920),
 Round(fac*620),Round(fac*450),0,0,960,600,CBRDIB.Bits,
 InfoHD,DIB_PAL_COLORS,SRCCOPY);

I have also tried DIB_RGB_COLORS aswell in the StretchDIBits
procedure. Problem being on SOME systems the bitmap will
print either completly grey or black. On ours both ways
works perfect. Is the palette the problem, or maybe the
3rd party dcu (or something else entirely)?

Any help would be greatly appreciated.
0
Comment
Question by:boabyte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
jorgen.hojdmo earned 0 total points
ID: 1338520
Hi!

First, from your code i can't see if you have set the RGBQUAD array in InfoHD. Second, To be able to use StretchDIBits demands Win32s or Win95. Finaly look att the following example.

http://www.borland.com/devsupport/delphi/ti_list/TI3155.html

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

726 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