# Graphics constructs with an Image reference?

**URL:** <https://forum.juce.com/t/graphics-constructs-with-an-image-reference/8986>\
**Category:** General JUCE discussion\
**Created:** [July 17, 2012, 9:44pm UTC](https://forum.juce.com/t/graphics-constructs-with-an-image-reference/8986 "2012-07-17T21:44:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheVinn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thevinn/32/806_2.png) [@TheVinn](https://forum.juce.com/u/TheVinn)\
**Post date:** [July 17, 2012, 9:44pm UTC](https://forum.juce.com/t/graphics-constructs-with-an-image-reference/8986/1 "2012-07-17T21:44:28Z")

</div>

Graphics takes an Image reference, is this a legacy hold over? Because Image objects are now reference counted handles to separately allocated implementation objects, shouldn’t imageToDrawOnto be passed by value?

juce\_GraphicsContext.h

```auto
explicit Graphics (const Image& imageToDrawOnto);
```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [July 18, 2012, 8:05am UTC](https://forum.juce.com/t/graphics-constructs-with-an-image-reference/8986/2 "2012-07-18T08:05:19Z")

</div>

Not sure I understand your point…? If it passed it by value, the compiler would generate an extra unnecessary copy, which wouldn’t do any harm, but I can’t think of any reason why you’d actually want it to do that…?
