I have been wanting to get a thumbnail of websites for quite some time using the web browser control in Windows Phone.
My Question is quite simple, is there a way to gaining a thumbnail of the web page a user is currently on. I have done this before using C# standard web browser control and the DrawToBitmap method but this doesn't exist in Windows Phone (Atleast I was unable to find any documentation suggesting otherwise)
If there is anything you guys know that could point me in the right direction besides using online services such a glimpse or Amazon's Thumbnail Generators as I would like to keep this activity within the app, I don't want to do extra calls to another web service when the data is right there in their web browser.
I was hoping if there was a invoke script I don't know about or some libraries that are supported in Windows Phone which are able to do just this.
Thanks for your help, if you require more information just ask, or if you would like to know what or why I want this I will explain further here:
I have a News App that allows users to access a select few feeds, I have a dedicated page that hosts the web browser control to display the webpage with some other functionality like sharing the website using your email or pinning the web site to your home screen, I just want a more custom experience than the generic web browser one. And I think a thumbnail of the website would be nice as the Tiles background
If you have a better Idea on how to tackle something like this please do let me know I am open to suggestions :)
You could try rendering the browser control to a WriteableBitmap:
var bitmap = new WriteableBitmap(400, 400);
bitmap.Render(browserControl, null);
bitmap.Invalidate();
You can then use this bitmap as an ImageSource.
Related
I was trying to make a pc application that helps people more conveniently when they are using a browser(e.g Chrome, Firefox, Edge ...)
For example, the application shows the default browser and let user can choose another browser as default if they want to, and the app shows all windows that are currently opened; Overmore, when the user clicks a specific window then app will focus the window.
user can select default browser
user can see all windows categorized by browser type
So, my initial planning was using Election js; however, I've found that there is no way to control a browser from the Electron application since Node js cannot access the users' system(this thinking could be wrong since I have poor English😥)
After some research, I'm guessing C# can do that by using windows api. I've saw this post that saying by using DDE, we can get tabs urls.
But I'm wondering if C# can fully control a browser; for instance, create a new window, notice if music or video is playing in the tab, request to browser for getting favorites list.
If it cannot, how about requesting api to the browser from pc application?
You cannot fully control a browser. Internet Explorer was the only browser that had a documented and supported API to control, inspect and automate. Internet Explorer is dead so this is a dead end. The basic DDE control interface is also outdated.
Accessing favorites and the content of open tabs is limited because evil people would use such APIs to inject and spy. If you want to access the favorites you will have to write custom code for each browser.
Using the accessibility and UI automation APIs is the only reliable and supported way of interacting with modern browsers. SetWinEventHook can be used to detect window creation and primitive state changes. MSAA/UI Automation needs to be used to get more information from each browser window.
The thumbnail API and/or magnifier API can be used to get the preview image.
To open a new tab, execute a new process with the URL on the command line. Some per-browser customization might be required (-new-tab parameter etc).
Use IApplicationAssociationRegistration::QueryCurrentDefault to detect the default browser.
I would like to know if it's technically possible to develop a WinForm or WPF C# application that can interact with any web browser tab.
Let's imagine I have a Chrome web page with a web form. I would like to run a WinForm app and be able to point and select a web form field to get the data in it. Exactly like the F12 feature of a browser when you can use the Select feature and use your mouse to select a DOM element.
As shown on attached screenshot.
F12 is a feature within the web browser, but how can I reproduce the same behaviour with an external custom WinForm/WPF application ?
Is it even possible?
I don't think there is a way to achieve what you want to do.
If there was, anyone could write a program to read all of the data you input into your browser, that would be a security nightmare.
yes, you can do it using Selenium.
Check this out: Selenium.
I've a C# WPF application developed in VS 2015, and I want the browser to read some data from it. Just a short string. I can save it in a text file, or in a variable but it should be visible to the browser (using JS I suppose). For instance using file:/// doesn't work if the original page is hosted online - as in my case (different source conflict). This should work in Opera and FFox, but looking at their extensions, it seems you can only develop with front-end technologies, which are not enough in my case since I use WPF to look into Win OS, and then I need to share the result with the browser.
I suspect it's possible, and no , it's not to write a malicious piece of code. For instance I can read the details of the graphic card for diagnostic purposes.
Please help, many thanks.
Browsers run in a security sandbox which is intended to stop them reading or writing files to the file system.
You could write to the user's appdata. There are various javascript frameworks which persist data to there so they can provide offline or static data.
I don't think that is a good plan though.
I suggest your first candidate would be a cookie.
Quick google on how to do that, I find:
How to create cookie in c#.net windows application?
From a web page you can use the content of a cookie dynamically. So you could change what you see in the web page after it's up and running from some process in your wpf app and do a counter or whatever.
I've not used this with windows apps and a browser but I have with a web app and Silverlight. I'm afraid I don't have that code to hand though.
For my semester assignment, I want to make a simple C#/.NET windows desktop application that will call the Instagram API and use its Photo Effects/Filters.
But my professor has said that the app must be a standalone windows desktop app which means it should not have any internet or database connectivity.
For example: If a user selects an image/photo from his computer using the desktop application (that I want to develop), I want the application to show a bunch of instagram filters that can applied to that image (without internet or any database connection).
My basic question: Is it possible for me to develop such an app that uses the instagram API but does not need any internet or database connectivity? If it is possible, can you guys guide me? I have visited instagram.com/developer/authentication/ link but I am not sure what to do. And if it is not possible, is there any other way to make an app that applies some effects/filters to an image? Please help me out. Thanks.
EDIT: I am still a little confused though. When we use intagram on phone, we use internet only when we want to upload a photo. Filters are offline features. So is there any way I can get these features from the API? As my teacher said I 'can use API but not internet' I assumed APIs can work without the need of an internet connection.
To implement offline image processing, you would either need an assembly of the filters or the actual code. I don't think that Instagram provides such tools. But there are plenty of third party libraries out there for image processing, if that's what you are looking for. For instance the AForge image processing.
Who knows how to display the video from website in windows application?
This is the site
I want to write an application to it. Can I do it without knowing API? Or if there is no API.
I will be very grateful for the help.
The most basic way would be to use a WebBrowser control and use an embed link (if it exists) or parse the HTML to obtain the flash object with the correct parameters.