There are many apps that have the ability to resize buttons or anything else like the image below.
How can I do something like that from scratch?