OSM to raster image in my application.

hi, I’m starting to make an application based on a map.
The application is quite simple, at the start a position is inserted and a fixed map must be displayed, what I can change is only the zoon level with discrete levels (10 zoom level). Everything must be done with offline maps.

The simplest thing that came to my mind is to download the osm map of the entire area of interest (I have no problems with storage space) and when the application starts, after entering the location, create 10 png images of the map with the various zoom levels and to show time to time the image corresponding to the desired zoom level.

The question then is: how to switch from a map in osm format to a png (or similar) image of a sub area with the desired zoom level?

my application is a C ++, the ideal would be to do everything in C ++, but I can also call an external application for conversion.

Can anyone help me?
Thanks in advance.