Offscreen Picture to Canvas

I’m working on a mapping project:
Display raster maps and vector data (Coordinates stored in SQLite)
I don’t know how to display vector data on a canvas
I know how to draw a polygon with g.DrawLine() directly in the Paint method but
I’m not sure using the paint event is a good idea because I may have hundreds of dots, polylines and polygons to display.
What I think of is to draw into a picture offscreen and draw that picture in the paint event of the canvas but how?
The code should be in a method where I access to the database
Thank you for your help
jjc_Mtl

Add a picture variable to a module
Initialise it as new picture (w,h)
Draw on the graphics property

When the canvas’ Paint event occurs, use

g.drawpicture myPicture,0,0

to display whatever it looks like at that moment

Thank you for your Answer;
Here is what I did:
Create a property (OffScreenPic) for an existing Module (EspaceCarto)
Initialize OffScreenPic in the open event proc. of the main window (the one that includes the canvas);
I initialize a lot of things there:
EspaceCarto.OffScreenPic = New Picture(Fenetre1.Canvas1.Width, Fenetre1.Canvas1.Height)
On this window, there is a button that call a method containing that:

EspaceCarto.OffScreenPic.Graphics.DrawLine(10,10,100,100) EspaceCarto.OffScreenPic.Graphics.DrawString("Test...", 200, 200)
in the Paint event:

g.DrawPicture (EspaceCarto.OffScreenPic, 0, 0)
No bug reported but nothing happens. I’ve try to put the drawing instructions directly in the button action code; no luck.
Did I forgot something? sure but what?
jjc_Mtl

invalidate the canvas so that it gets refreshed once you clic the button ?

Cool!
that’s it!
Thank you to both of you!
I will post a screen copy of my first map soon.

jjc_Mtl