Canvas line

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Canvas line

Karol Gryger
Hi


is it possible to draw line on canva in qooxdoo using HTML5.


It is easy in HTML5 see example below but don't know how to do that in qooxdoo

Thanks,
   Karol

<!DOCTYPE HTML>
<html>
<head>
<script> window.onload = function() { var canvas=document.getElementById("myCanvas"); var context=canvas.getContext("2d"); context.moveTo(100,150); context.lineTo(450,50); context.stroke(); } </script></head>
<body>
        <canvas id="myCanvas" width="578" height="200"></canvas>
</body>
</html>



Thanks,
     Karol Gryger (www.family3.org)
Reply | Threaded
Open this post in threaded view
|

Re: Canvas line

Marc Puts
Hi Karol,

You need to add the Canvas widget (qx.ui.embed.Canvas) to your
application and then use it's getContext2d method to obtain a reference
to it's drawing context. Once you have that reference it's exactly the
same as you would do without qooxdoo.

I created a playground example to demonstrate how you would draw a
line:  http://tinyurl.com/4vvexj9

Marc


On 03/22/2011 11:17 AM, grykar wrote:

> Hi
>
>
> is it possible to draw line on canva in qooxdoo using HTML5.
>
>
> It is easy in HTML5 see example below but don't know how to do that in
> qooxdoo
>
> Thanks,
>     Karol
>
> &lt;!DOCTYPE HTML&gt;
>
>
>


------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Canvas line

Gabriel Munteanu
In reply to this post by Karol Gryger
It is easy in qooxdoo too.
you can use http://demo.qooxdoo.org/1.3.x/apiviewer/#qx.ui.embed.Canvas if you are doing a full blown  qooxdoo app , or you can use http://demo.qooxdoo.org/1.3.x/apiviewer/#qx.html.Canvas for a bom type app.

here is a playground example for your line:
http://tinyurl.com/4wz2pk7

you could also check out the demo: http://demo.qooxdoo.org/1.3/demobrowser/index.html#widget~Canvas.html
Reply | Threaded
Open this post in threaded view
|

Re: Canvas line

Karol Gryger
In reply to this post by Marc Puts
Gabriel, Marc

thanks a lot for quick response it solves my issue

Karol
Thanks,
     Karol Gryger (www.family3.org)