# is it possible to use a PNG image as an icon entry of a vtkLegendBoxActor ?

**URL:** https://discourse.vtk.org/t/is-it-possible-to-use-a-png-image-as-an-icon-entry-of-a-vtklegendboxactor/194
**Category:** Support
**Created:** [February 1, 2019, 10:27am UTC](https://discourse.vtk.org/t/is-it-possible-to-use-a-png-image-as-an-icon-entry-of-a-vtklegendboxactor/194 "2019-02-01T10:27:13Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [February 1, 2019, 10:27am UTC](https://discourse.vtk.org/t/is-it-possible-to-use-a-png-image-as-an-icon-entry-of-a-vtklegendboxactor/194/1 "2019-02-01T10:27:13Z")

</div>

Hi,

The question is in the title.

I tried that, but I only got a black square instead of the image.

```
vtkNew<vtkPNGReader> reader;
reader->SetFileName("icon.png");
vtkImageData* icon = reader->GetOutput();
...
vtkSmartPointer<vtkLegendBoxActor> legend = 
vtkSmartPointer<vtkLegendBoxActor>::New();
  legend->SetNumberOfEntries(1);
...
  legend->SetEntry(2, icon, "Label", color);
```
