Would someone be willing to take a look at this small project and see if they can figure out why it bombs?
The idea is to have a window with just an HTMLVIEWER that would download a Webpage, snap a picture and return the image
I need to have this done invisible to the user (so ultimately I would move the one window in the project off screen entirely)
Everything works… EXCEPT when I try to programmatically close the Snapshot window… the program bombs…
If I comment out the self.close line, it works, but I have to manually close the window (which I do not want)
I created a small project that uses HTMLViewer.Drawinto to place the picture of the HTMLVIewer into a canvas backdrop and it worked fine on Mac. Once on Windows, it did not work anymore. Windows simply does not drawinto anything from an HTMLViewer, would it be of the control itself, or the window on which it is.
[quote=87859:@Dave S]Would someone be willing to take a look at this small project and see if they can figure out why it bombs?
The idea is to have a window with just an HTMLVIEWER that would download a Webpage, snap a picture and return the image
I need to have this done invisible to the user (so ultimately I would move the one window in the project off screen entirely)
Everything works… EXCEPT when I try to programmatically close the Snapshot window… the program bombs…
If I comment out the self.close line, it works, but I have to manually close the window (which I do not want)
when i run the project i see a window with the ‘take a snapshot’ button and when i click on it… it just bomb and close the app and the come out with the scary error ‘problem report for my application.debug’’
[quote=87859:@Dave S]Would someone be willing to take a look at this small project and see if they can figure out why it bombs?
The idea is to have a window with just an HTMLVIEWER that would download a Webpage, snap a picture and return the image
I need to have this done invisible to the user (so ultimately I would move the one window in the project off screen entirely)
Everything works… EXCEPT when I try to programmatically close the Snapshot window… the program bombs…
If I comment out the self.close line, it works, but I have to manually close the window (which I do not want)
[quote=90448:@Michel Bujardet]I created a small project that uses HTMLViewer.Drawinto to place the picture of the HTMLVIewer into a canvas backdrop and it worked fine on Mac. Once on Windows, it did not work anymore. Windows simply does not drawinto anything from an HTMLViewer, would it be of the control itself, or the window on which it is.
I just created a bug report about that : 33637[/quote]
The LR purports it does. Then if it does not work, it is a bug, and should be reported as such, even if workarounds exists.
And worse yet, the Mac HTMLViewer is exhibiting the same glitch.
Either DrawInto works as described in the LR, or the feature should be fixed. Or maybe Xojo engineers are less competent than users who simply applied API calls ?
Finally I found the solution I need in my Desktop application.
ControlSnapShot
I have tested it and I saw it working very well expect one thing.
May I make a question?
I use lots of HTMLViewer(Webkit) for drawing JavaScript Charts.
I found out that if HTMLViewer is running with ‘Webkit’ mode, your ControlSnapShot doesn’t snap anything.
Hi Christian
Just resurrecting this thread,
I’m a subscriber to MBS and was wondering…
is it possible using MBS to take a snapshot of a WebHTMLViewer into a jpg or pdf?
what ever is simpler?
i.e. have a site up and snap it.
The use is Facebook ad previews. It seems impossible to grab the preview image
so I was wondering if I can simply snap the viewer?
Thanks Christian
Regards James
You’re going to have a lot of trouble trying to accomplish an image snapshot with WebHTMLViewer. Webpages generally don’t have access to the content of iframes to prevent malicious use.
IIRC Facebook ad previews are text/css, so if they still are you could copy the styling and generate your own.
(guess who doesn’t have facebook! ¯\(?)/¯ )