Solved

Delphi Programming question

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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