StrokeImageBytes Property

Defines the image for a stroke image or pattern fill.

Namespace:  Aspose.Words.Drawing
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public byte[] ImageBytes { get; }

Property Value

Type: Byte
Examples
Shows how to process shape stroke features.
// Open a document which contains a rectangle with a thick, two-tone-patterned outline
Document doc = new Document(MyDir + "Shape stroke pattern border.docx");

// Get the first shape's stroke
Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);
Stroke s = shape.Stroke;

// Every stroke will have a Color attribute, but only strokes from older Word versions have a Color2 attribute,
// since the two-tone pattern line feature which requires the Color2 attribute is no longer supported
Assert.AreEqual(Color.FromArgb(255, 128, 0, 0), s.Color);
Assert.AreEqual(Color.FromArgb(255, 255, 255, 0), s.Color2);

// This attribute contains the image data for the pattern, which we can save to our local file system
Assert.NotNull(s.ImageBytes);
File.WriteAllBytes(ArtifactsDir + "Drawing.StrokePattern.png", s.ImageBytes);
See Also