Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom Shape (Read 1990 times)
feege
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Dec 10th, 2007
Custom Shape
Dec 10th, 2007 at 2:27am
Print Post  
Hi,

I am trying to get the code to work that defines a custome shape.

I have copied this code into my .NET webform

private void example_Click(object sender, System.EventArgs e)

     {

           // define a custom shape

           // this is the same as: fc.DefaultShape = ShapeTemplate.FromId(“Tape”);

           fc.DefaultShape = new ShapeTemplate(

                 new ElementTemplate[] {

                       new LineTemplate( 50, 100,  85, 100),

                       new LineTemplate( 85, 100,  85,  90),

                       new LineTemplate( 85,  90,  70,  90),

                       new BezierTemplate( 70,  90,  85,  90, 100,  75, 100,  50),

                       new BezierTemplate(100,  50, 100,  25,  75,   0,  50,   0),

                       new BezierTemplate( 50,   0,  25,   0,   0,  25,   0,  50),

                       new BezierTemplate(  0,  50,   0,  75,  25, 100,  50, 100) },

                 FillMode.Winding);

     }

But I get an error message that says "The name 'FillMode' does not exist in the current context"

Can someone help me here please

Thanks

Geoff
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Shape
Reply #1 - Dec 10th, 2007 at 6:48am
Print Post  
Hi,

FillMode is defined in the System.Drawing.Drawing2D namespace, so you should either import the namespace using an Imports directive, or use the fully qualified type name: "System.Drawing.Drawing2D.FillMode.Winding". If you need to use this shape in applet mode, you will have to save it in a shape library file, and assign the file URL to the ShapeLibraryLocation property.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint