I have question to Java or C# programmers. I want to render some pages in various browsers mainly Firefox and IE and save it as a picture. I have not any serious experience in Java/.Net. Is there any libs/tools for such tasks? I thought about some FF extensions for example but I don't know how to do it in IE. Is the in .Net some libs for dealing with it? Maybe some ActiveX? Any sugestions?
http://www.vesic.org/english/blog/winforms/render-html-to-quality-jpeg/
I'm not sure what your end goal is, but perhaps http://browsershots.org/ offers the functionality you're looking for? It would appear they offer both an XML-RPC interface and also the source code freely.
Edit: It looks like the source code link isn't properly hooked up currently.
You can use the FireFox Screengrab extension - it's very handy!
"Screengrab! is an extension that
makes it easy to save a web-page as an
image β itβs a screen capture tool for
Firefox!
With it, you can save anything that
you can see in a browser window β from
a small selection, to a complete
page."
Related
I'm trying to dynamically generate images for the og:image preview for a particular urls.
Given the designs/stack the easiest option for layout seems to be html/css/reactjs, so just trying to render out to an image using a headless browser of some kind.
Ideal would be js libraries or npm packages, but happy to use any stack to do the rendering (c#, java, anything). If I can't find something thinking maybe have to adapt something used in ux testing?
(That is, I guess I sort of need something like browsershots but only for one browser, only the top section of the page, and ideally running on my server).
Any ideas or suggestions greatly appreciated π thank you.
I'm completely new to Selenium but I'm aware it's capable of taking browser screenshots. Though, I was wondering if it's able to take screenshots of multiple browsers, specifically chrome, firefox and IE.
Thanks
PS: I'm working with c#
While it is possible to take screenshots with Selenium for multiple browsers, there are some things that you might want to consider before choosing it as your implementation:
As emd mentioned, you will need to create a driver for each type of browser that you wish to take screenshots of as each has a different (internal) implementation for taking screenshots,
Currently the ChromeDriver is not capable of taking a full-screen screenshot (it will only take a screenshot of the current viewport, see here for more details),
Selenium is unable to take screenshots when a dialog box is present. If you are trying to take a screenshot of an unexpected dialog, this can be quite annoying.
As an alternative, you could implement a generic screenshot method in .Net. Have a look into Graphics.CopyFromScreen() method from System.Drawing. This implementation will be browser independent. See here for more details, or Google search some examples of its use for full screen screenshots =]
I've been using Google's Annotated Time Line Visualization component for the last couple of weeks and I love it! I've been able to make plots with about 10k points without much trouble.
Do you know of a desktop component I could plug into my application that delivers the same WOW factor that Google's component does? I don't care what the language/toolkit is. I prefer C#,Java,Ruby,C++ or Python... (in that order) however any other's would apply. I also prefer it to be free and open source, but if it's not that's OK as well.
Thanks for your time!
Note: This doesn't have to be cross-platform. Windows is fine.
Edit (2009-08-07):
Even if I can only plot 10k points, I am fine with that. I would just like a desktop control that delivers the same "wow" factor and works in a similar manner (zooming, scrolling, annotations, etc) that the Google component does.
Edit (2009-09-03):
I really prefer the language to be C#. I started a bounty to see if anyone can find some good ones. I want it to be almost identical to Google's Annotated Timeline Component. I would use Google's Component, but I want a desktop component... and I don't want to run into performance limitations because of the browser. Using Adobe Air is out of the question.
Edit (2009-09-03):
Do not recommend Visifire. I have evaluated it, and it doesn't support zooming. Remember, it must be very close to Google's component in terms of functionality and "wow" factor.
This WPF-based chart control at codeproject may put you in the right direction. It's got smooth panning/zooming/scrolling :
WPF Chart Control With Pan, Zoom and More By John Stewien
If you're needing to plot millions of points, you're going to run into performance issues quickly if the control doesn't have a mechanism for loading/sampling only what it needs to display. Even then, that's a very large number of data point to want to access in one control.
Hm i am not sure if this is what you are looking for, but for java there is the very good library JFreeChart which is not exactly as interactive as the one you mentioned but it is really easy to use and pretty flexible for you to subclass and tweak to your preference.
Perhaps you could take a look at matplotlib. It's a python based library, however it's very flexible in that it can take it's input from a variety of sources.
An alternative is to embed a web browser control in you wpf application. You'll probably need access to the DOM, so you might have to use the WebBrowser in a WinForm. A good article descibing how this is done can be found here.
Microsoft also has free chart control you can get at http://www.microsoft.com/downloads/details.aspx?FamilyId=130F7986-BF49-4FE5-9CA8-910AE6EA442C&displaylang=en. It's pretty good--especially for being free.
I have used Dundas charts in the past. They are excellent but pricey. There are several other vendors with good chart controls including DotNetCharting, Telerik, Component Art, and Infragistics.
i want to implement Ms Paint like feature in my web application in c# asp.net. like cropping coloring zooming ,color picker etc . Please tell me is there any pre build tools or application for it.Any pointers and suggestion would be much appreciated. Thanks !
you can use jquery plugin....
http://www.webresourcesdepot.com/jquery-image-crop-plugin-jcrop/
http://www.webappers.com/2008/09/12/jcrop-poweerful-image-cropping-engine-for-jquery/
If your looking for C#, your only option is Silverlight.
If you can do something other than C#, theres Adobe Flash, as well as some JavaScript. JavaScript can be limited (though I have seen some pretty nice ones) when it comes to graphics, unless you want to use the Canvas tag. The only problem with the Canvas tag and JS is that it is not fully supported in all browsers yet.
How can I implement ActiveX Document on C#/.NET? (ActiveX Document can draw itself in IE)
Update: I need a solution for drawing my own document type in IE windows (like MS Word or MS Excel draw its documents in IE).
You need to dive into OLE for that purpose.
Things like IOleDocument, IOleInPlaceSite (see MSDN for that). Figure out which interfaces are needed for the client (as IE would be the container and will need to communicate with your interface implementations), and how the communication is going on, e.g. what gets called when.It's not rocket science, but I believe still a fair amount of work.
Look at http://msdn.microsoft.com/en-us/library/system.windows.forms.htmldocument.domdocument.aspx, it's .NET wrapper for DOM Document
My first thought is that you could use a WPF Page, which can be hosted in a WPF window or in IE.
From MSDN:
Encapsulates a page of content that can be
navigated to and hosted by Windows
Internet Explorer, NavigationWindow,
and Frame.
This is possible but it is tough.. What is bad is the lack of documentation... Microsoft has no interest in supporting this scenario. Another difficult part is debugging the boundaries between the HTML/DOM and the ActiveX control.
For what you're doing, it sounds like Silverlight would be a better choice. It only supports a subset of .Net, but it supports drawing graphics. It'll be a lot easier for you to find documentation. And it will run on non-Windows computers.
But maybe you need something Silverlight doesn't do (like audio input support). If thats the case, there's various blogs on the subject of varying quality. Here are the two that stood out as most helpful to me:
http://www.codeproject.com/KB/cs/CreateActiveXDotNet.aspx
http://blog.ianchivers.com/wordpress/?p=22
I do recommend using OleView to inspect the type libraries you produce, and make sure its what you expect. You can also do this to see how to break event properties into get/set functions, which is something I had to do to debug some scenarios.
Also be cognizant of the difference of "attaching debugger to process" with scripted or managed debugging. At some point you'll attach with one when you think you've used the other.