Breaking a big Texture2D into smallers

Hello all,
I have a image with dimensions of 320 x 320 with some smaller images and I want to get these images of 64 x 64

I found some topics about creating an atlas, but the explanations were using smaller images and generating the bigger.
[edit]
Example:

I have this image (100 x 100):

12948-example.png

I want to break it in 4 textures of 50x50 (on the lines).

Like: Tex1 = circle; Tex2 = red rectangle; …

What can I do? Thanks in advance and sorry my bad english.

Breaking an image apart at runtime is a bit ugly and you may increase your texture usage (i.e. have the ‘atlas’ plus the new textures plus any overhead associated with having a texture read/write enabled). There is an example of how create a new image from a rectangle in the reference page for Texture2D.GetPixels(). If you do implement this way, you will need to mark your texture as read/write enabled. Also I recommend you use Texture2D.GetPixels32() rather than GetPixels().

A potential alternate solution is to use Graphics.DrawTexture(). Based on the reference page, it should do the job of displaying a portion of a texture, but I’ve not verified that it will work the way you want.

A better solution (from a performance and memory usage standpoint) would be use place your image on a plane. Then you could use material settings or modify the UV coordinates in the mesh to display part of the image.