[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

Delphi Programming question

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
boabyte
Asked:
boabyte
1 Solution
 
jorgen.hojdmoCommented:
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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now