CanvasRenderingContext2D in Pascal or C++ lazarus / 39-Graphics ---------------------------------------------------------------------- sarason · 2015-10-17 07:35 I am trying to port a web graphics application back to Lazarus Pascal and C++ Builder. It doesn't need any of the alpha channel stuff but it does need rotations and transforms. Specifically: ctx.clearRect ctx.canvas.width ctx.canvas.height ctx.save();    ctx.transform() ctx.canvas.height; ctx.translate() ctx.restore(); ctx.lineCap ctx.strokeStyle ctx.beginPath(); ctx.moveTo(wire.x1, wire.y1); ctx.lineTo(wire.x2, wire.y2); ctx.lineWidth = wire.width; ctx.stroke(); ctx.lineCap = 'round'; ctx.strokeStyle = color; ctx.beginPath(); ctx.moveTo(wire.x1, wire.y1); ctx.lineTo(wire.x2, wire.y2); ctx.lineWidth = wire.width; ctx.stroke(); ctx.strokeStyle ctx.beginPath(); ctx.arc(); ctx.lineWidth ctx.stroke(); Now is there a library available that does this without Java dependencies? A code fragment someone has implemented? A better way ? regards sarason ---------------------------------------------------------------------- Leledumbo · 2015-10-17 12:34 Quote from: sarason on October 17, 2015, 09:35:06 amNow is there a library available that does this without Java dependencies? A code fragment someone has implemented? A better way ? LCL, BGRABitmap, anything else with TCanvas descendant or similar implementation minus the path things. ---------------------------------------------------------------------- Dibo · 2015-10-17 17:05 Quote from: Leledumbo on October 17, 2015, 02:34:06 pmLCL, BGRABitmap, anything else with TCanvas descendant or similar implementation minus the path things. [/quote] I'll add also AggPas (available from Lazarus -> Package -> Install / Uninstall -> find package "aggpaslcl"). But AFAIK it has bugs on linux http://www.crossgl.com/aggpas/aggpas-demo.htm ---------------------------------------------------------------------- circular · 2015-10-22 17:24 BGRABitmap library provides a Canvas2d property which imitates HTML5 functions and syntax ---------------------------------------------------------------------- aradeonas · 2015-10-22 18:10 Get last version of BGRABitmap and compile project in the testcanvas2d folder and take a look at test number 16 its show you an easy and fast way to use.