[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Re[2]: Programmatically creating filled shape characters (wa

From: Udo Giacomozzi
Subject: [Gnash-dev] Re[2]: Programmatically creating filled shape characters (was: Drawing bitmaps)
Date: Tue, 13 Feb 2007 17:48:33 +0100

Hello strk,

Tuesday, February 13, 2007, 4:37:09 PM, you wrote:
s> Which is *left* and which *right*  between m_fill0 and m_fill1 ?
s> (not documented)

See \page render_handler_intro:

/// - Each path has up to two fill styles and no or one line style. The line
///   style should be obvious. The two fill styles define the fill to the left
///   (fill style zero) and to the right (fill style one) of the path if you
///   think of it like a vector. The fill style is defined by a index to a 
///   list of previously defined fill style definitions. Index 0 means "no 
///   style" and is equal to a fully transparent fill style ("hole", if you 
///   wish).

Again, Gnash's fill style is Flash fill style minus 1.

s> mm... I'm too dumb to understand how to create the edges.
s> I suppose the definition below doesn't work ?

s>         edge e01(10, 10, 0, 10);
s>         edge e12(0, 10, 0, 0);
s>         edge e23(0, 0, 10, 0);
s>         edge e30(10, 0, 10, 10);

An edge has four coordinates, yes, but that's not the start and ending
point. Instead, it has a anchor and a control point. The starting
point of the edge is defined by the path's anchor point or by the
previous edge, respectively. The control point describes the curve the
edge should go along (quadratic bezier) and equals the anchor point
for straight edges:


             .   c  .
        .               .
     .                     .
   o                         a

straight line:

o = origin (previous edge / path anchor point if first edge)
c = control point
a = anchor point

So, in your case c := a.

A 20x10 rectangle (origin 0/0) would be:

      path p(20, 10, 0, -1, -1);
      edge es0(20,  0, 20,  0);  // right side
      edge e01( 0,  0,  0,  0);  // top side
      edge e12( 0, 10,  0, 10);  // left side
      edge e23(20, 10, 20, 10);  // bottom side

I changed the edge names because 0-1 is the *second* edge.

Replace "20" with "width" and "10" with "height" and you're there...

BTW, there is no reason to start at the bottom right corner, you can
also start at 0/0 if you wish. It's just that Flash starts at the
bottom right corner AFAIK. 

Hope I could clarify some things :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]