Jump to content
Sign in to follow this  
JanF

External HTML in OSD

Recommended Posts

JanF

Hi all!

 

I am trying to make a new page for the NewDef skin that I would like to display the current traffic in the Copenhagen area.

 

The URL for the content is: http://vd.adapt.dk/index_kbh_dk.html

 

Using the Skineditor I cannot seem to find an element that allows me to insert the above URL??

 

Can anyone give me a hinter or two? Be warned - I am in no way a programmer >_<

 

Thanks in advance

 

Jan

Share this post


Link to post
Tjod

As fare as i know it is not possible.

 

(For a Programmer it should be possible. A start point is may be this)

Share this post


Link to post
JanF
As fare as i know it is not possible.

 

(For a Programmer it should be possible. A start point is may be this)

 

Thanks for the heads-up - I took a look, but for a programmer you are right - it could be a starting point :-)

 

I do not need any control - just to have a page I can access from the HTPC-home menu that will show the URL..

Share this post


Link to post
hackbart

You should search for the internet plugin i published (2 years ago, i guess). It was just a sample plugin, but explains how to embedd the explorer into the osd.

Share this post


Link to post
JanF
You should search for the internet plugin i published (2 years ago, i guess). It was just a sample plugin, but explains how to embedd the explorer into the osd.

 

Hi Hackbart

 

If you mean the plugin named MyInternet I already took a look - but it seems to be an uncompiled fully functional explorer - not excatly what I need (...and I would not have a clue on how to use / compile it ;) )

 

I was thinking something in the line of MyWeather - but instead of the forecast, the main window should simply display the content from the URL above...

 

Maybe a page where one could simply enter the default URL to display?? Which could be usefull for others??

Share this post


Link to post
hackbart

What you can do is creating a script which starts the attached binary multiple times. The tool allows to save the website as jpg on your harddisk. If you now add this image to your skin you should be able to see the traffic in your area.

The parameter works like this:

webdump http://vd.adapt.dk/index_kbh_dk.html traffic.jpg

 

procedure TfrmWebbrowser.GenerateBitmap(Bitmap: TBitmap);
var
 srcRect: TRect;
 aViewObject: IViewObject;
 W, H: Integer;
begin
 aViewObject := Webbrowser.ControlInterface as IViewObject;
 if aViewObject = nil then Exit;
 H := Webbrowser.OleObject.Document.ParentWindow.Screen.Height;
 W := Webbrowser.OleObject.Document.ParentWindow.Screen.Width;

 WebBrowser.Height := H;
 WebBrowser.Width := W;
 Webbrowser.Realign;
 Bitmap.Width := W;
 Bitmap.Height := H;
 srcRect := Rect(0, 0, Bitmap.Width, Bitmap.Height);

 OleCheck(aViewObject.Draw(DVASPECT_CONTENT, 1, nil, nil,
Handle,
Bitmap.Canvas.Handle,
@srcRect, nil, nil, 0));
end;

 

 

The program just uses the webbrowser ability to save the content as bitmap and i'm quite sure this can be also done inside a script.

 

Christian

WebDump.zip

Share this post


Link to post
JanF

Christian - this seems like the almost perfect solution!!

 

The Webdump.exe works perfectly with most pages I have tried, but unfortunately not with the above page in question :-(

 

The page containes a Java Applet - when I try to "grap" the page with the utility, it simply generates an hs_err_pid****.log??

 

Hope you will keep trying - I really appreciate your help!!

 

/jan

Share this post


Link to post
JanF

UPDATE

 

Updated my Jave to the Version 6 Update 5 - I no longer get the error-log, but just a blank *.jpg-file...

Share this post


Link to post
JanF

I am close to a solution - is there anyway I can get wepdump.exe to use a wait-timer?? I would like it to start - give the webpage 10 secs. to load completely, and then make the .jpg snapshot.??

Share this post


Link to post
hackbart

The attached zip contains the binary and the source. In theory you could create a application which hides itself in the tray and refreshs the stream periodically - but i guess this simple tool should work in your case.

 

webbrowser url filename [delay in seconds]

 

Christian

webbrowser.zip

Share this post


Link to post
JanF

Christian - thanks - works perfectly!!

 

Is it possible to ad the option to set the size of the captured image?? When I grab the above URL with the 10 sec delay, I get a huge image, but really only need the top left corner cut 650x650..??

Share this post


Link to post
JanF

Hi Christian (and others :rolleyes: )

 

webbrowser.exe hangs after grabbing the page - the delay works perfectly and the grab is successfull, but I have to use taskkill /IM webbrowser.exe /T /F to shut it down..?? Are you able to fix this??

 

My solution so far is to grab the image and then use another script to crop the image to the desired size... but as webbrowser.exe keeps hanging, I am currently using two different scripts - one to launch webbrowser.exe - another to run the taskkill and the crop - not really beautifull ^_^

 

Thanks in advance

 

/jan

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...