Hi,
i try to build web app using WCL as well as a pure pas2js (if i can call it that). Basically the second way (without using WCL) gives me more flexibility in using graphic objects like rectangles, arc, circle and so on. But to build some usable gui for my users it takes more effort in comparision to WCL. So my question - how to paint some graphic on canvas of TWform? Lets say: an arc, in pas2js i paint it on canvas in that way:
c:=TJSHTMLCanvasElement(document.createElement('canvas'));
ctx:=c.getContextAs2DContext('2d');
with ctx do
begin
beginPath;
linewidth:=7;
arc(50,90,40,pi,1.5*pi,false);
strokeStyle:='#FF0000';
stroke;
end;
with document.body do
appendChild(c);
but have no idea how to do it using WCL. Even if I add this code snippet in WButton OnClick procedure this won't show me graphic. I see created canvas in Chrome's console , but probably using
with document.body do
appendChild(c);
makes it in wrong place or is so anyway bad idea..
So hmm..
Regards,