# How to create a "Play" button with image?

**URL:** <https://forum.juce.com/t/how-to-create-a-play-button-with-image/59675>\
**Category:** Getting Started\
**Created:** [January 25, 2024, 3:19am UTC](https://forum.juce.com/t/how-to-create-a-play-button-with-image/59675 "2024-01-25T03:19:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CutieBearx](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@CutieBearx](https://forum.juce.com/u/CutieBearx)\
**Post date:** [January 25, 2024, 3:19am UTC](https://forum.juce.com/t/how-to-create-a-play-button-with-image/59675/1 "2024-01-25T03:19:28Z")

</div>

I am attempting to create an image button for a DJ deck that works to play the mp3 file loaded in.

The text button (not the image button) works perfectly but how do I can change it to a image button for the same function?

Thank you to the members of JUCE for your patience with us _University of London Goldsmiths_ comp sci students.

---

<div class="post-metadata">

**Author:** ![zsliu98](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zsliu98/32/22502_2.png) [@zsliu98](https://forum.juce.com/u/zsliu98)\
**Post date:** [January 25, 2024, 8:21pm UTC](https://forum.juce.com/t/how-to-create-a-play-button-with-image/59675/2 "2024-01-25T20:21:04Z")

</div>

Use the ImageButton and I think it will be fine. Optionally, you can provide an image to your custom LookAndFeel (of the button) and draw it at wherever you like. For example,

> <https://github.com/ZL-Audio/ZLEqualizer/blob/main/source/gui/button/compact_button/compact_button_look_and_feel.hpp#L23>

---

<div class="post-metadata">

**Author:** ![CutieBearx](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@CutieBearx](https://forum.juce.com/u/CutieBearx)\
**Post date:** [January 26, 2024, 12:44pm UTC](https://forum.juce.com/t/how-to-create-a-play-button-with-image/59675/3 "2024-01-26T12:44:39Z")

</div>

to modify the looks and feel… do we like put this code in a new header file or cpp file? Can you show a example of Image button?

Thank you! 😇

---

<div class="post-metadata">

**Author:** ![zsliu98](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/zsliu98/32/22502_2.png) [@zsliu98](https://forum.juce.com/u/zsliu98)\
**Post date:** [January 27, 2024, 12:04am UTC](https://forum.juce.com/t/how-to-create-a-play-button-with-image/59675/4 "2024-01-27T00:04:26Z")

</div>

The following documentation of `ImageButton` is pretty clear. You can construct an `ImageButton` and provide an(or several) image(s) to it with `setImages`. Which part do you not understand?

[https://docs.juce.com/master/classImageButton.html](https://docs.juce.com/master/classImageButton.html)

---

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [January 27, 2024, 7:22am UTC](https://forum.juce.com/t/how-to-create-a-play-button-with-image/59675/5 "2024-01-27T07:22:52Z")

</div>

Check the ArrowButton too [JUCE: ArrowButton Class Reference](https://docs.juce.com/master/classArrowButton.html) which you can inspire yourself for the implementation
