# Push button image

**URL:** <https://discourse.processing.org/t/push-button-image/7880>\
**Category:** Libraries\
**Created:** [January 27, 2019, 4:09pm UTC](https://discourse.processing.org/t/push-button-image/7880 "2019-01-27T16:09:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dolomiti](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dolomiti](https://discourse.processing.org/u/Dolomiti)\
**Post date:** [January 27, 2019, 4:09pm UTC](https://discourse.processing.org/t/push-button-image/7880/1 "2019-01-27T16:09:32Z")

</div>

Is it possible to put a push button image ?. Control.lp5, from Sojamo libraries

Thank you

```auto
 //cp5.addButton("columns_1_rows_1") //position of button
  cp5.addButton("A")
    .setPosition(30, 170) //x and y coordinates of upper left corner of button
    .setSize(60, 60) //(width, height)
    .setFont(font)

```

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [January 29, 2019, 6:38pm UTC](https://discourse.processing.org/t/push-button-image/7880/2 "2019-01-29T18:38:24Z")

</div>

I think you might want to add an image to a button?

Here is the example from the ControlP5 library:

[http://www.sojamo.de/libraries/controlP5/examples/extra/ControlP5imageButton/ControlP5imageButton.pde](http://www.sojamo.de/libraries/controlP5/examples/extra/ControlP5imageButton/ControlP5imageButton.pde)

…and past related discussions of cp5 images and control elements:

> **[Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/27795/controlp5-changing-image-button-to-the-clicked-image-without-actually-clicking-it)**
>
> Processing is an electronic sketchbook, a language and a worldwide community. This is its forum.

> [@Cp5 Knob: how to use an image?](https://discourse.processing.org/t/cp5-knob-how-to-use-an-image/1143):
>
> hey everybody, I have a problem i can’t seem to solve: I want to use an image instead of the standard Knob-layout. It works fine with buttons, toggles, … but not with knobs? Anyone got any idea what I’m doing wrong? Here’s (part of) my code: import controlP5.\*; ControlP5 cp5; PImage turnKnob; void setup() { size(860, 582); cp5 = new ControlP5(this); PImage[] turnKnob = {loadImage("turnKnob\_small.png"),loadImage("turnKnob\_small.png"),loadImage("turnKnob\_small.png")}; cp5.ad…
