Profile Picture

How to fill a custom shape with color or texture?

Posted By Marius Bucur 15 Years Ago
Author
Message
Marius Bucur
Posted 15 Years Ago
View Quick Profile
Junior Member

Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 12, Visits: 1
I am trying to fill a custom shape with color or a texture, but so far i have no luck. Basically my code look like this:

GraphicsPath graphicsPath = new GraphicsPath();

PointF[] points = new PointF[]
{
new PointF(0, 0),
new PointF(0, 20),
new PointF(20, 20),
new PointF(20, 0),
};
graphicsPath.AddPolygon(points);
//InitTextures();
NCompositeShape shape = new NCompositeShape();
shape.Primitives.AddChild(new NCustomPath(graphicsPath, PathType.OpenFigure));
shape.UpdateModelBounds();
//NImageFillStyle img = new NImageFillStyle(this.textures["bricks"] as Bitmap);
//img.TextureMappingStyle.MapMode = MapMode.RelativeToObject;
//shape.Style.FillStyle = img;
shape.Name = "Basic Wall";
shape.Text = "Basic Wall";


shape.Style.FillStyle = new NColorFillStyle(Color.AliceBlue);
shape.Style.StrokeStyle = new NStrokeStyle(1, Color.FromArgb(0, 0, 0x88));




Similar Topics


Reading This Topic