# ImageButton problem

**URL:** <https://forum.juce.com/t/imagebutton-problem/12608>\
**Category:** General JUCE discussion\
**Created:** [March 27, 2014, 3:19pm UTC](https://forum.juce.com/t/imagebutton-problem/12608 "2014-03-27T15:19:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gaxel](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@gaxel](https://forum.juce.com/u/gaxel)\
**Post date:** [March 27, 2014, 3:19pm UTC](https://forum.juce.com/t/imagebutton-problem/12608/1 "2014-03-27T15:19:30Z")

</div>

Hi all,

I'm&nbsp;trying to display an ImageButton, loading the three images from file.

```
Image normal = ImageFileFormat::loadFrom(juce::File("Normal.png"));
Image over = ImageFileFormat::loadFrom(juce::File("Over.png"));
Image down = ImageFileFormat::loadFrom(juce::File("Down.png"));

ImageButton* btnImg;
btnImg = addToList(new ImageButton("Test"));
btnImg->setBounds(150, 310, 1, 1);
btnImg->setImages(true, false, true, normal, 1.0f, Colours::black, over, 1.0f, Colours::white, down, 1.0f, Colours::yellow);
```

The images seem to be loaded correctly, but I do not see them, instead I see a black square of the size of the image (and white if over, yellow if button down). Also, if I put a listener, it response correctly to the click...

Where am I wrong? If I create a TextButton instead, everything works fine.

Thanks

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [March 27, 2014, 6:14pm UTC](https://forum.juce.com/t/imagebutton-problem/12608/2 "2014-03-27T18:14:17Z")

</div>

hi.

i think it's because your colours are opaque! try adding some transparency to it :

Colours::black.withAlpha (0.2f)

---

<div class="post-metadata">

**Author:** ![gaxel](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@gaxel](https://forum.juce.com/u/gaxel)\
**Post date:** [March 31, 2014, 8:38am UTC](https://forum.juce.com/t/imagebutton-problem/12608/3 "2014-03-31T08:38:00Z")

</div>

Many thanks
