TeeCanvas3d + Antialias drawing LineSeries dualcolor

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
JES
Newbie
Newbie
Posts: 12
Joined: Thu Feb 06, 2014 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Mon Mar 10, 2014 12:00 pm

Hi,

I don't think that you have compiled your version with global project define: TEEANTIALIAS (because in picture you have two pixels width horizontal line).

So your version uses actually GDI+ library to draw that antialias version.

When TeeChart sources are compiled with TEEANTIALIAS define it still draws non horizontal lines in wrong color.

Janne

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Fri Mar 14, 2014 11:50 am

Hi Janne,

We're studying the problem and we'll be back here asap.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Fri Mar 14, 2014 3:02 pm

Hello Janne,

I'll send a beta version of the TeeChart sources to the mail account you have registered in this forum so you can test this.
Now, adding the TEEANTIALIAS define, we get this:
image.png
image.png (25.89 KiB) Viewed 10543 times
Note the color isn't perfect. This is because our AntiAlias is doing a blending with the background and it gives blue-greyed line.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

JES
Newbie
Newbie
Posts: 12
Joined: Thu Feb 06, 2014 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Tue Mar 18, 2014 6:32 am

Hi,

it is better now, but when data is dense and lines overlaps each other it still looks bad.
Can it be fixed like it was in older versions.

Dense data
DualColor.png
DualColor.png (130.2 KiB) Viewed 10558 times
Data that does not overlap lines is better (actually this kind of data/drawing GDI+ is good)
ok.png
ok.png (39.3 KiB) Viewed 10553 times
Thanks,
Janne

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Tue Mar 18, 2014 3:44 pm

Hi Janne,

It doesn't look so bad for me only changing the color and the number of values.
Isn't this what you get with the example some posts above and the following changes?

Code: Select all

  with Chart1.AddSeries(TFastLineSeries) as TFastLineSeries do
  begin
    Color:=clRed;
    //AddArray([10,10,12,1,15,13,13]);
    FillSampleValues(100000);
    BeforeDrawValues:=SeriesBeforeDrawValues;
    AfterDrawValues:=SeriesAfterDrawValues;
  end;
2014-03-18_1637.png
2014-03-18_1637.png (33.91 KiB) Viewed 10500 times
On the other hand, having so many overlapping points makes the chart difficult to read. You may be interested on setting the TFastLineSeries DrawAllPoints property to false or reducing the number of points with the TDownSamplingFunction.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

JES
Newbie
Newbie
Posts: 12
Joined: Thu Feb 06, 2014 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Tue Mar 18, 2014 5:32 pm

Hi,

it looks same as your sample.

I am drawing process data values and user can choose freely resolution, so it can contain a lot of values (and I don't want to reduce visible points programmatically, eq. DrawAllPoints:=false; if user have choosen to see accurate data).

Why is it not possible to get old Antialias drawing back, this does not look good (I'm using now GDI drawing with these new versions but old Antialias was much nicer looking).

This is not acceptable
image.png
image.png (381.79 KiB) Viewed 10484 times
Thanks,
Janne

JES
Newbie
Newbie
Posts: 12
Joined: Thu Feb 06, 2014 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Mon Apr 07, 2014 5:56 am

Hi,

any news on this issue?

Janne

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Mon Apr 07, 2014 11:57 am

Hi Janne,

I'm sorry for the late reply here. We're studying what changed and what's the best way to go we can suggest you.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by Yeray » Tue Apr 08, 2014 2:28 pm

Hi Janne,
Yeray wrote:I'm sorry for the late reply here. We're studying what changed and what's the best way to go we can suggest you.
We've just corrected it.
Since the fix is simple and you are a source code customer, we can tell you the changes to apply. At TeeAntiAlias.pas you'll find the BlendColor (in your case it may be BlendColor1):

Code: Select all

procedure TAntiAliasCanvas.BlendColor(const AX,AY:Integer; const Dist:Single);
At the beginning of this function you'll find this:

Code: Select all

      if IFilter.RGBA then
      {$R-}
      with IFilter.LinesRGBA[AY,AX] do
      {$IFDEF WASRANGE}
      {$R+}
      {$ENDIF}
      begin
        // BGR
        Red:=Round(Dist*(Red-r))    + r;
        Green:=Round(Dist*(Green-g))+ g;
        Blue:=Round(Dist*(Blue-b))  + b;
      end
Modify the above for this:

Code: Select all

      if IFilter.RGBA then
      {$R-}
      with IFilter.LinesRGBA[AY,AX] do
      {$IFDEF WASRANGE}
      {$R+}
      {$ENDIF}
      begin
        // BGR
        Red:=Round(Dist*(Red-b))    + b;
        Green:=Round(Dist*(Green-g))+ g;
        Blue:=Round(Dist*(Blue-r))  + r;
      end
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

JES
Newbie
Newbie
Posts: 12
Joined: Thu Feb 06, 2014 12:00 am

Re: TeeCanvas3d + Antialias drawing LineSeries dualcolor

Post by JES » Thu Apr 10, 2014 5:12 am

Hi,

great, now it works fine, thanks!

Janne

Post Reply