Is there a drop in VCL TCanvas replacement that does antialiasing? I see a bunch of things on StackOverflow and Google about this but I don't really see a drop in replacement. This is for a stock chart. It uses PolyLine a lot. Maybe Graphics32?

Comments

  1. I think graphics32 is your safest bet here. Native solution, very performance. I've used it for years for this very task.

    ReplyDelete
  2. I can recommend AggPas as Edwin Yip mentioned. I've been using it for a couple of years now, and the results and features are fantastic. There are a couple of versions (forks) of AggPas floating around on the internet - I'm maintaining my own version too, in conjunction with the custom drawn fpGUI Toolkit.

    ReplyDelete
  3. Haven't tried it yet but this looks decently drop in:

    var
    d2dCanvas: TDirect2DCanvas;
    begin
    d2dCanvas := TDirect2DCanvas.Create(Canvas,
    Rect (0, 0, Width, Height));
    // limited surface
    // Rect (0, 0, Width div 2, Height));

    d2dCanvas.BeginDraw;
    try
    d2dCanvas.Brush.Color := clWhite;
    d2dCanvas.Pen.Color := clBlack;
    d2dCanvas.Ellipse(100, 100, Width div 2, Height - 100);
    d2dCanvas.DrawLine(
    D2D1PointF(100, 100),
    D2D1PointF(Width - 100, Height - 100));
    finally
    d2dCanvas.EndDraw;
    d2dCanvas.Free;
    end;

    Canvas.Ellipse(Width div 2, 100, Width - 100, Height - 100);

    ReplyDelete

Post a Comment