# Slow UI, how do I use setBufferedToImage effectively?

**URL:** <https://forum.juce.com/t/slow-ui-how-do-i-use-setbufferedtoimage-effectively/14233>\
**Category:** General JUCE discussion\
**Created:** [January 29, 2015, 11:22pm UTC](https://forum.juce.com/t/slow-ui-how-do-i-use-setbufferedtoimage-effectively/14233 "2015-01-29T23:22:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evad](https://avatars.discourse-cdn.com/v4/letter/e/a4c791/32.png) [@evad](https://forum.juce.com/u/evad)\
**Post date:** [January 29, 2015, 11:22pm UTC](https://forum.juce.com/t/slow-ui-how-do-i-use-setbufferedtoimage-effectively/14233/1 "2015-01-29T23:22:25Z")

</div>

I have some components which I animate moving around and scaling but contents never change. They have a lot of text, vector graphics, and other things and they render slow as mud. When I set `setBufferedToImage(true)` the performance increases greatly when the components are not moving, but as soon as I start to move/scale them it triggers a repaint, and I go down to 2fps again.

Is there a way to set it so scaling a whole component won't result in a repaint?&nbsp;What is the right way to handle this?

---

<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:** [January 30, 2015, 8:52am UTC](https://forum.juce.com/t/slow-ui-how-do-i-use-setbufferedtoimage-effectively/14233/2 "2015-01-30T08:52:49Z")

</div>

That's what you'd expect - whenever the component changes size, it'll need to refresh its buffered image.

You could roll your own cached image and scale it? Or it might be possible to do something clever involving a custom subclass of&nbsp;CachedComponentImage.
