'Pick a section of an image in c#

I have an image with multiple portraits inside, how can I pick each one of them without cutting the image in photoshop or something like that. The image would be 8 images in row by 3 columns can I do this programatically? Links would help to learn about this topic, not looking for free code, I genuinly don't know how to google for this. I know in Unity they use images like that for animations and I guess somehow loop through them. In my case I only need to pick one randomly.

I added unity tag because game developers might be more familiar with this. If my title isn't great please free to edit it.

This is the image

thank you



Solution 1:[1]

You can import texture as multiple sprites. Select it in the project hierarchy and then select Multiple.

.enter image description here

After that, you can click Sprite Editor to split the texture.

enter image description here

enter image description here

In my case, it sliced the picture like this:

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Andriy Marshalek