9-patch Allows the Creation of Embedded Graphic Images with Scalability

Application design usually means working with an abundance of graphics, and when designing applications for multiple screen sizes, designers have to keep in mind how those images will scale when deployed across different resolutions and aspect ratios. A button that looks great on one screen might have awkward corners or warped text when scaled to fit a screen of a different size. To avoid this, designers often create multiple versions of their graphics in various sizes. While this allows for tight control over the visual presentation of the graphics, it also means extra time, effort, and resources.

 

So how do we create graphics with scalability in mind without having to duplicate effort, bloat file resources, or sacrifice quality? Enter 9-patch.

 

What is a 9-patch image?

Essentially, a 9-patch image is a custom graphic that scales the way that you intend it to, which you define when creating the graphic. Where supported, this stretchable image is automatically resized to accommodate the content as defined. The "as defined" part is what allows designers to retain control over how a graphic looks even when it is resized.

 

Check out this example. Both buttons look the same before, but the 9-patch button retains it's original appearance when resized to be slightly wider and much higher. The other image scales poorly, especially at the border and corners.

 

9_patch Blog image

How to define the stretchable areas of an image

9Patch-2

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
 

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Related Articles

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

Industrial HMI screen interface with embedded GUI in a professional support environment, representing customer assistance and contact point.

Talk to an Embedded GUI Expert

Speak with our team to explore how Storyboard can support your embedded GUI goals.