How do a paint a PNG file on a WebCanvas ?

I had a simple OSX app which composed a picture from a number of PNG files on a canvas. I have converted the app to a web app, but I am really struggling with the different objects when working with a WebCanvas rather than a regular Canvas.

Has anyone got a snippet of code they would be happy to share which loads a png or jpg and displays it onto a WebCanvas.



Then code to display a picture on a WebCanvas should be identical to the code to display it on a desktop Canvas. In the Paint event handler you would do something like this:

// Load the picture. You'd really want to cache this in a property of the web page, however, // so that you only access the disk and load the picture once. Dim f As FolderItem = SpecialFolder.Documents.Child("MyPicture.png") Dim p As Picture = Picture.Open(f) g.DrawPicture(p, 0, 0)

If you’re going to cache the image, use a WebPicture instead of a Picture.