Solved

Delphi Programming question

Posted on 1997-07-09
1
157 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
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

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

9 Experts available now in Live!

Get 1:1 Help Now