You should do the next steps of the program yourself, with the example programs have the basic principles.
3. This is relatively easy, based on the oblic line drawing you can adapt it for horizontal and vertical lines.
2. This a bit more complicated.
You must define what exactly you want, because the principle may be different according to what you need.
- Memorizing only the bitmap or memorizing also the object type and its properties.