Print in Grayscale
Print in Grayscale
Hello,
I'm using the feature TeeGrayScale() in the afterDraw method, but I can't use it also to pring the chart in grayscale. Is it possible ? Thanks
I'm using the feature TeeGrayScale() in the afterDraw method, but I can't use it also to pring the chart in grayscale. Is it possible ? Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bertrod,
You can try something like what Marjan suggested here and adding this line:
You can try something like what Marjan suggested here and adding this line:
Code: Select all
pDMode^.dmColor:=DMCOLOR_MONOCHROME;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcis,
Ok but my problem is that Monochrome is different than Grayscale :
chart.monochrome looks different than teeGrayscale(), and moreover i'm also using the reverted grayscale (white becomes black, etc.).
Seeing your answer, I should understand that you did not yet implement the printing in the "real" grayscale ?
If not, then i will use your proposition for now, and I hope printing in grayscale will be implemented in the next releases.
Regards
Ok but my problem is that Monochrome is different than Grayscale :
chart.monochrome looks different than teeGrayscale(), and moreover i'm also using the reverted grayscale (white becomes black, etc.).
Seeing your answer, I should understand that you did not yet implement the printing in the "real" grayscale ?
If not, then i will use your proposition for now, and I hope printing in grayscale will be implemented in the next releases.
Regards
Hi bertrod,
to create a grayscale Chart you must use (as you said) the TeeGrayScale, and to be able to print it in grayscale you will have to use a Metafile and StretchDraw method to print it directly.
to create a grayscale Chart you must use (as you said) the TeeGrayScale, and to be able to print it in grayscale you will have to use a Metafile and StretchDraw method to print it directly.
Code: Select all
procedure TForm1.BitBtn2Click(Sender: TObject);
var meta : TMetafile;
begin
Chart1.BevelOuter := bvNone;
Meta := Chart1.TeeCreateMetafile(True, Chart1.ClientRect);
try
Printer.Orientation := poPortrait;
Printer.BeginDoc;
try
Printer.Canvas.StretchDraw(Rect(1,1,Printer.PageWidth - 1,
Printer.PageHeight - 1),Meta);
finally
Printer.EndDoc;
end;
finally
Meta.Free;
Chart1.BevelOuter := bvRaised;
end;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi Pep,
Thanks for the answer but your solution doesn't work. I'm using the filter right before creating the Metafile, and then I'm using it to print, but the chart is still not in grayscale.
Do you have maybe another solution ?
Thanks for the answer but your solution doesn't work. I'm using the filter right before creating the Metafile, and then I'm using it to print, but the chart is still not in grayscale.
Code: Select all
TeeGrayScale((Chart.Canvas as TTeeCanvas3D).Bitamp, true, 0) ;
MetaChart := Chart.TeeCreateMetaFile(True, Chart.ClientRect) ;
...