Solved

Delphi Programming question

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi IDE crash without error message ... 7 99
Dev express lookupcombo 3 34
How to load 2 images in same column in Delphi 2 57
DBCtrlGrid, Delphi, Scroll 7 26
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

856 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