Draw Button with GUITexture which looks like Unity button

Hey Guys,

I was wondering how unity draws buttons (if drawn in the OnGUI function). When I look into a GUI skin, the default button background is an image with only 12x12 pixels.
I now want to use the same image with a GUITexture. But because the size is 12x12 pixels, the texture becomes ugly and pixelated if I increase the size of the GUITexture. So how Unity is able to draw a good looking button from this small image, no matter how big you want the button? And how can I do the same with a GUITexture?

Thanks for your help.

you could use a 12x12 pixels to build a x*y pixels button, you could make a function to get the corner 4x4, the mids 4x4, 1x4 or 4x1 and the center 4x4 to resize in any texture size you need, some getpixels, and a local texture2d would do the trick, the corners would stay the same, but the mids and center will repeat the number required to close the gaps, just a little math here and there and you are done