trichview.com

trichview.support.thirdparty




Re: ChartItem and Print preview


Return to index


Author

Message

Sergey Tkachenko

Posted: 06/19/2002 17:03:37


Yes, this is a problem of ChartItem.


Open ChartItem.pas, find Print method and change it to:


var sv: Integer;

    bmp: TBitmap;

begin

   if Preview then begin

     bmp := TBitmap.Create;

     bmp.Width := Control.Width;

     bmp.Height := Control.Height;

     TChart(Control).Draw(bmp.Canvas, Rect(0,0,

Control.Width,Control.Height));

     Canvas.StretchDraw(Bounds(x,y,dli.Width,dli.Height),bmp);

     bmp.Free;

     end

   else begin

     sv := SaveDC(Canvas.Handle);

     TChart(Control).PrintPartial(Bounds(x,y,dli.Width,dli.Height));

     RestoreDC(Canvas.Handle, sv);

   end;

end;


>

> Is it me or doesn't ChartItem work in the preview? I get "Printer is not

printing

> error?". If indeed it doesn't work, what is needed to get it working?

>

> Regards,

> .. D





Powered by ABC Amber Outlook Express Converter