trichview.support
Re: Change field backcolor for Print/PrintPreview |
Author |
Message |
Sergey Tkachenko |
Posted: 07/04/2005 18:31:46 1) Temporary, while printing, link to another RVStyle having the same collections of styles (you can copy them like rvs2.TextStyles := rvs1.TextStyles), but with some changed attributes. It's not necessary to iterate through all items in the document, you can only modify text styles. 2) Use RVStyle.OnApplyStyleColor procedure TForm3.RVStyle1ApplyStyleColor(Sender: TRVStyle; Canvas: TCanvas; StyleNo: Integer; DrawState: TRVTextDrawStates; var DoDefault: Boolean); begin if Canvas.Font.PixelsPerInch=Screen.PixelsPerInch then exit; Sender.TextStyles[StyleNo].ApplyColor(Canvas, Sender, DrawState, True, RVPrint1.ColorMode); Canvas.Brush.Style := bsClear; DoDefault := False; end; This code detects if it's printing by comparing the Canvas resolution and screen resolution. I think it's safe, because printers have much higher resulution than the screen. |
Powered by ABC Amber Outlook Express Converter