Hello,
I want to create a clip area and then reset it. I'm confused about that. See:
http://www.w3.org/TR/2dcontext/#clipping-region
"The clip() method must create a new clipping region by calculating the
intersection of the current clipping region and the area described by the path,
using the non-zero winding number rule. Open subpaths must be implicitly closed
when computing the clipping region, without affecting the actual subpaths. The
new clipping region replaces the current clipping region."
Actually the new clip region is not replacing the previous one but is adding to
the previous one. See ยง3:
http://www.rgraph.net/blog/2013/january/an-example-of-the-html5-canvas-clip-function.html
As ResetClip is missing I have to play with save / restore.
Source code that illustrate that, I draw 3 bars. One with a first clip region
(left square box), One with a second clip region (right square box) and finally
one with the original context:
Context.Get_Drawing_Context_2D (App.My_Canvas);
context.save;
context.Stroke_Rectangle((100, 100, 100, 100));
context.Stroke_Rectangle((150, 100, 100, 100));
context.Begin_Path;
context.Rectangle((100,100,100,100));
context.Clip;
context.Fill_Rectangle((50, 120, 250, 5));
context.Begin_Path;
context.Rectangle((150,100,100,100));
context.Clip;
context.Fill_Rectangle((50, 150, 250, 5));
context.Restore;
context.Fill_Rectangle((50, 180, 250, 5));
See result:
Is there something else easier?
Thanks, Pascal.
http://blady.pagesperso-orange.fr
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list