# Create Custom Image Bullets

## Environment

<table>
<thead>
	<tr>
		<th>Product Version</th>
		<th>Product</th>
		<th>Author</th>
	</tr>
</thead>
<tbody>
	<tr>
		<td>2020.1.316</td>
		<td>RadPdfProcessing</td>
		<td><a href="https://www.telerik.com/blogs/author/martin-velikov">Martin Velikov</a></td>
	</tr>
</tbody>
</table>

## Description

Create a custom [ListLevel](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.ListLevel.html) with custom bullets that contain images.

## Solution

Create a custom class that implements [IBulletNumberingFormat](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.IBulletNumberingFormat.html) and pass it to the [BulletNumberingFormat](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.ListLevel.html#collapsible-Telerik_Windows_Documents_Fixed_Model_Editing_Lists_ListLevel_BulletNumberingFormat) property of the [ListLevel](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.ListLevel.html) class.

```csharp

	RadFixedDocument document = new RadFixedDocument();

	Table table = new Table();
	TableRow firstRow = table.Rows.AddTableRow();
	TableCell tableCell = firstRow.Cells.AddTableCell();

	List list = this.GetCustomBullet();

	Block block1 = tableCell.Blocks.AddBlock();
	block1.SetBullet(list, 0);
	block1.InsertText("Sample block text 1");

	Block block2 = tableCell.Blocks.AddBlock();
	block2.SetBullet(list, 0);
	block2.InsertText("Sample block text 2");

	Block block3 = tableCell.Blocks.AddBlock();
	block3.SetBullet(list, 0);
	block3.InsertText("Sample block text 3");

	RadFixedDocumentEditor editor = new RadFixedDocumentEditor(document);
	editor.InsertTable(table);
 
```

**Example 1: Creating a Custom Image Numbering Bullet**

```csharp

	private List GetCustomBullet()
	{
		List list = new List();

		for (int i = 0; i < 3; i++)
		{
			ListLevel level = list.Levels.AddListLevel();
			level.ParagraphProperties.FirstLineIndent = -72;
			level.ParagraphProperties.LeftIndent = 0;
			int currentLevelIndex = i;

			level.BulletNumberingFormat = new CustomBullet((indexer) =>
			{
				Image image = new Image();

				for (int levelIndex = 0; levelIndex <= currentLevelIndex; levelIndex++)
				{
					image = new Image() { Width = 25, Height = 25 };
					using (Stream stream = new FileStream($"Images/Image{indexer.GetCurrentIndex(levelIndex)}.png", FileMode.Open))
					{
						image.ImageSource = new Telerik.Windows.Documents.Fixed.Model.Resources.ImageSource(stream);
					}
				}

				return image;
			});
		}

		return list;
	}

```

**Example 2: Creating a Custom Class That Implements IBulletNumberingFormat**

```csharp

	internal class CustomBullet : IBulletNumberingFormat
    {
        private readonly Func<IListLevelsIndexer, Image> getBullet;

        public CustomBullet(Func<IListLevelsIndexer, Image> getBullet)
        {
            this.getBullet = getBullet;
        }

        public PositionContentElement GetBulletNumberingElement(IListLevelsIndexer listLevelsIndexer)
        {
            Image positionContentElement = this.getBullet(listLevelsIndexer);
            return positionContentElement;
        }
    }
	
```

## See Also

* [ListLevel API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.ListLevel.html)
* [IBulletNumberingFormat API Reference](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Fixed.Model.Editing.Lists.IBulletNumberingFormat.html)
