VFP samples include dawing on the titlebar of a window, I don't think you need a specialty, actually an empty form is/has a canvas you can draw on. A container would just make the coordinates. You don't need to compare this with HTML5 canvas drawing.
Proof of Concept:
Code:
Do system.app && gdiplusx system.app
oDrawing = _screen.system.Drawing
_screen.addobject('Container1','Container')
loBmp = oDrawing.Bitmap.FromFile(GetFile('bmp'))
loRect = loBmp.GetBounds()
loGfx = oDrawing.Graphics.FromHWnd(_screen.HWnd)
loGfx.DrawImage(loBmp,_screen.container1.left,_screen.container1.top,_screen.container1.width, _screen.container1.height, loRect)
Now what's missing is explicitly using memory management methods like
Code:
loGfx.Dispose()
loBmp.Dispose()
No fear, the image will still be there. Code samples you find usually don't include such explicit garbage collection calls.
There's something else that's not as usual, once you wipe the program editor window over that container region, the image disappears, it's not an image control that also handles several Windows events about clipping and redrawing/refreshing.
There's some work to do, if you need to be fully compatible, but in other situations like full screen POS or kiosk systems that can already suffice. And mouse pointer will not wipe away the graphics.
Some more things to consider: Since this draws on a form by its HWND, the rectangle you draw on will not automatically be clipped by overlapping containers, when you draw on the container rectangle, this will not draw on the container "canvas", it has none, it shares the form canvas, you'll see the draw even if the container is on an inactive page of a pageframe, for examüle, so those things would need to be handled by your image control code. But you have more control over the disposing of resources and thus memory usage and garbage collection.
Bye, Olaf.
Olaf Doschke Software Engineering