Page 1 of 1

Drawing Chart is blank

Posted: Tue Jan 31, 2012 5:52 pm
by 10546565
In previous versions, I used Method 1 below without fail. But in moving to the latest version, it doesn't work. I did some testing and Method 2 works fine:

Code: Select all

    //Method 1    
    lChart.Draw(aRG.Bitmap.Canvas, lRect);
    CodeSite.Send('Batch Gap Chart', aRG.Bitmap);  //  <--- this is blank

    //Method 2
    lBmp := lChart.TeeCreateBitmap(clWhite, lRect);
    try
      aRG.Bitmap.Assign(lBmp);
      CodeSite.Send('Chart Bitmap', lBmp);
    finally
      lBmp.Free;
    end;
I implemented Method 1 in a demo application and it worked fine. Any reason it might not be working?

Re: Drawing Chart is blank

Posted: Wed Feb 01, 2012 12:11 pm
by yeray
Hi Ed,

I'm trying the following in a new simple application with just a chart and two TImage in the form, and everything works as expected in the actual version, doesn't it for you?

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TBarSeries).FillSampleValues();

  Chart1.Draw(Image1.Canvas, Chart1.ClientRect);
  Image2.Picture.Bitmap.Assign(Chart1.TeeCreateBitmap(clWhite, Chart1.ClientRect));
end;

Re: Drawing Chart is blank

Posted: Wed Feb 01, 2012 4:28 pm
by 10546565
It works in my demo, but it did not work in my application. I cannot tell you why.

Re: Drawing Chart is blank

Posted: Thu Feb 02, 2012 10:04 am
by yeray
Hi Ed,

There were some changes in the drawing process in the last releases:
http://www.teechart.net/support/viewtop ... 438#p49438

So I wouldn't discard the possibility that some related functions may have been affected.
If you find an easy way to reproduce it consistently so we can reproduce, debug,... it here, we'll be pleased to take a deeper look at it.