How to copy a rectangle area from a texture to another one

I wanted to know how to copy a rectangular area of one texture to another texture.

For instance copy from texture A’s coordinates 0,0 (x1, y1) 100,100 (x2,y2) to texture B’s coordinates 100,100 (x1, y1) 200,200 (x2, y2)

This was easy to do in Director becuase they had a great blitting interface to manipulate textures. In .NET you can use many of the standard system.drawing functions, but I am not sure how well those work on the MAC.

Since I don’t see any thing jumping out at me in looking through the Unity functions, I am really hoping I am missing something. This is something that is very important for the product we are designing. I am sure there is probably a way and I am just missing it :?

Thanks for any help!

to write them back:

Check the GetPixels and SetPixels funcitons in Texture2D. It sounds like you should have a good idea of what to do from there.

1 Like

You can also use this if you want to copy the whole texture:

You can also reference the whole texture: