That looks right. I suggest making your pictures into shared properties though. That way you only load then once for your whole project, instead of every time the paint event fires.
Behind the scenes, a webimageview is created which asks the browser to download the image. Once it gets there, the browser asks for a repaint to get the latest code ( in case it has changed). You may be getting into a situation where the image is never current.
No. The pictures will get converted to WebPicture before being sent to the browser. Every time you draw those pictures, new WebPictures will be created. To reuse the images, you might need to make invisible WebImageViews and draw those instead of pictures. See the LR.
It would be helpful to have a version of WebGraphics.DrawPicture that took a WebPicture as a parameter. Then you’d make the WebPicture a shared property of your WebPage.
I’m really confused.
The draw picture method takes a picture not a WebPicture.
I don’t see how I’m suppose to properly handle the Paint Event, iff that is the place it is meant to be drawn.
Maybe I shouldn’t be using a canvas to ‘hold’ the picture?
FWIW, because we keep the images around, we check to see if you are drawing the exact same picture, and if you are, we use the WebImageView that we already have.