gnash-dev
[Top][All Lists]
Advanced

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

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


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

Hello strk,

Tuesday, February 13, 2007, 2:25:44 PM, you wrote:
s> Unfortunately the shape_character_def class doesn't have much
s> useful methods, only read from SWF. Dunno wheter to extend 
s> it's interface or define new classes (I'm of the advice that more
s> classes keep things simpler to read and understand).

I would normally agree but I have the strong feeling that the original
Flash player does some sort of automatic conversion: it loads the JPG,
converts it to a shape and forgets completely that once it was a JPG.

At least I would recommend to create a descendant of
shape_character_def.

As for the definition: Basically it should be enough if you:
  - add the bitmap as it's only fill style
  - add one path with four edges:


  1               0
    +-----------+
    |           |
    |           |
    |           |
    +-----------o
  2               3

  The "o" marks the anchor point the path, the edges go
  counterclock-wise. Set the *left* fill style to 0 (= the bitmal fill
  style ID) and the *right* fill style to -1 (no fill).

  Note Flash *stores* the fill IDs differently (0=no fill, 1=first
  fill).

  Fill type should be SWF::FILL_CLIPPED_BITMAP.

Then everything should work just fine.

Udo





reply via email to

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