Okay, I kinda thought maybe I need to use banks to do this. Not too sure about how these work, so put together this snippet of code in my app as a stab in the dark. It does create an html file in the right place, but puts a load of garbage in it.
Also if I try this with a blank html file then the htmlview is displayed, but no print dialog box (which sounds like the problem that Gellyware had on another post).
Obviously I am misunderstanding how this stuff works (nothing new there). Could anyone throw some light on this for me please?
Case MENU_PRINT
Local bnkScreenPrint:TBank = CreateBank(intImageWidth * intImageHeight * 4)
Local pxmScreenPrint:TPixmap = LockImage(imgPrintable)
Local intPixel:Int
Local intCounter:Int
For Local y:Int = 0 To intImageHeight - 1
For Local x:Int = 0 To intImageWidth - 1
intPixel = ReadPixel(pxmScreenPrint,x,y)
PokeInt(bnkScreenPrint,IntCounter * 4,intPixel)
intCounter:+1
Next
Next
UnlockImage(imgPrintable)
SaveBank(bnkScreenPrint,"Images\Screen.html" )
Local gdthtmlview:TGadget = CreateHTMLView(0,0,ClientWidth(gdtwindow),ClientHeight(gdtwindow),gdtwindow,HTMLVIEW_NONAVIGATE)
HtmlViewGo gdthtmlview,AppDir+"/images/Screen.html"
GadgetPrint(gdthtmlview)