# 9-slice scaling UMG image

**URL:** <https://forums.unrealengine.com/t/9-slice-scaling-umg-image/123231>\
**Category:** UI\
**Tags:** unreal-engine\
**Created:** [March 6, 2019, 8:56pm UTC](https://forums.unrealengine.com/t/9-slice-scaling-umg-image/123231 "2019-03-06T20:56:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [March 7, 2019, 7:41pm UTC](https://forums.unrealengine.com/t/9-slice-scaling-umg-image/123231/4 "2019-03-07T19:41:09Z")

</div>

The margins are percentage, as you said. For the image you posted, you’d have to keep margins at 0.4 or 0.35 - eyeballing it here, you may get away with 0.3

A margin 0.4 for an image 100x100 pixels would mean that when you stretch the image, only the 20 pixels in the middle will be stretched. The 40% from all sides will just stick to the edges.

To get a good result, it’s always better to produce a base image that will never be scaled down, only up - basically make the smallest you will need and 9-slice that. Yours looks spot on.

edit: pixel size is weird because of how lazily I copypasta this 😑

![Untitled.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/c/cccc79b597427374e6816433c35b0f4cc3a7d706.png)

51 is 25% of 204. Your margins should be 0.25 or more. The text cannot be a part of the image, of course.

---

_[View the full topic](https://forums.unrealengine.com/t/9-slice-scaling-umg-image/123231)._
