Skip to content
Mats Alm edited this page Nov 2, 2023 · 20 revisions

Shapes

Supports adding 187 different types of shapes with multiple ways of formatting.

Example

var shape = ws.Drawings.AddShape("txtDesc", eShapeStyle.Rect);
shape.SetPosition(1, 5, 6, 5);  //Position Row, RowOffsetPixels, Column, ColumnOffsetPixels
shape.SetSize(400, 200);        //Size in pixels
shape.EditAs = eEditAs.Absolute;
shape.Text = "This example demonstrates how to create various drawing objects like pictures, shapes and charts.\n\r\n\rThe first sheet contains all subdirectories and files with an icon, name, size and dates.\r\n\r\nThe second sheet contains statistics about extensions and the top-10 largest files.";
shape.Fill.Style = eFillStyle.SolidFill;
shape.Fill.Color = Color.DarkSlateGray;
shape.Fill.Transparancy = 20;
shape.TextAnchoring = eTextAnchoringType.Top;
shape.TextVertical = eTextVerticalType.Horizontal;
shape.TextAnchoringControl=false;

shape.Effect.SetPresetShadow(ePresetExcelShadowType.OuterRight);
shape.Effect.SetPresetGlow(ePresetExcelGlowType.Accent3_8Pt);

See also

Sample 5.1 (C#) or Sample 5.1 (VB)

EPPlus wiki

Versions

Worksheet & Ranges

Styling

Import/Export data

Formulas and filters

Charts & Drawing objects

Tables & Pivot Tables

VBA & Protection

Clone this wiki locally