Show
Welcome!Hello and welcome to the introduction of Awesomium.NET, the official .NET wrapper for Awesomium. In this article, we’ll talk about Awesomium, how it integrates with .NET, and the exciting new possibilities it opens for .NET developers. What is Awesomium?Awesomium is a flexible, windowless, web-browser framework that is meant to be used in your own applications. Think of it as if we took Chrome, chopped it into smaller, re-usable pieces, and served it to you on a nice shiny 32-bit BGRA pixel-buffer platter. It is not an application, it is not a web-browser; it is a tool to add web-browser-like capabilities to another application. Think of radical new browsing interfaces, multi-touch, HTML UI, in-game browsing, web-page capture, site scraping, automation, and awesome new web-browser mashups. Awesomium is powerful and easy to use (it takes just 7 lines of code to render a page!) but gives you freedom when you want it. The framework handles almost all the low-level tasks for you (network stack, HTML parsing, JS engine, layout, rendering etc.) but you can absolutely redefine much of the low-level behavior if you’d like (expose methods and data to Javascript, implement your own resource back-end, modify headers, and more).
What does this mean for .NET applications?Let’s face it, the default WebBrowser control is fairly restrictive and out-of-date. It’s not much more than a wrapper around an IE ActiveX control and so you inherit all the limitations of Internet Explorer. .NET WebBrowser Source Code//------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // // Description: // WebBrowser is a wrapper for the webbrowser // activex control // Copied from webbrowser.cs in [....] // // History // 04/17/05 KusumaV Created // 02/22/08 [....] Expose the WebBrowser control // 04/24/08 [....] Implemented hosting the WebOC in the // browser process for IE 7+ Protected // Mode //------------------------------------------------------------- using System; using System.ComponentModel; using System.Runtime.InteropServices; using System.Windows; using MS.Win32; // [...] // namespace System.Windows.Controls { /// <summary> /// This is a wrapper over the native WebBrowser control /// implemented in shdocvw.dll. /// </summary> /// <remarks> /// The WebBrowser class is currently not thread safe. /// Multi-threading could corrupt the class internal state, /// which could lead to security exploits (see example in /// devdiv bug #196538). So we enforce thread affinity. /// </remarks> public sealed class WebBrowser : ActiveXHost { //---------------------------------------------- In short terms:
Same .NET 2.0 application running in 2 different systems How is Awesomium Different?
The Awesomium.NET ProjectThe Awesomium.NET project wraps all the exciting features of Awesomium into a set of technology-related .NET assemblies. The Awesomium.NET Assemblies:New Features:Starting with Awesomium SDK v1.6.3, we have a introduced a number of exciting new features to our .NET wrapper. Here are just some of them:
PresentationLet us take a closer look to each of the assemblies in Awesomium.NET and explore some of their major features. Awesomium.Core:The Awesomium.Core assembly wraps the core engine of Awesomium. It’s compiled against .NET Framework 4 Client Profile and is the major dependency between all Windows Awesomium.NET assemblies. Awesomium.Mono is the platform-independent equivalent and is compiled against .NET Framework 2. If you want to use Awesomium in your application and don’t mind handling display, input, and event-handling, then Awesomium.Core or Awesomium.Mono is all you need. The major components available in Awesomium.Core are:
Awesomium.Windows.Controls:The Awesomium.Windows.Controls assembly provides WPF developers with a ready to use, drag-and-drop, standalone WPF control that handles all the basic embedding tasks (mouse/keyboard input, rendering, resizing, cursors, focusing, etc.) and various utilities that can help WPF developers take advantage of all Awesomium features. Here are some details of what you can find in the Awesomium.Windows.Controls assembly:
WPF VB.NET Application Awesomium.Windows.Forms:Just like Awesomium.Windows.Controls, the Awesomium.Windows.Forms assembly provides Windows Forms developers with a ready to use, drag-and-drop, standalone Windows Forms control (that handles all the basic embedding tasks like mouse/keyboard input, rendering, resizing, cursors, focusing, etc.) and various utilities that can help Windows Forms developers take advantage of all Awesomium features. Here are some details of what you can find in the Awesomium.Windows.Forms assembly:
Installation and Redistribution:Awesomium.NET is distributed with the Awesomium SDK, available for download in: http://www.awesomium.com/download. Here is a list of what is installed with the Windows installer and where to find it: Awesomium.NET Assemblies:The original Awesomium.NET assemblies and the Awesomium libraries linked to them, can be found after installation under: %ProgramFiles%\Khrona LLC\Awesomium SDK\1.6.4\wrappers\Awesomium.NET\Assemblies The same directory also includes the Awesomium.Mono assembly. For details about how to use the Awesomium.Mono assembly in Windows, OS X or Linux, please read: Getting Started with Awesomium.Mono. In GAC:The following assemblies are also automatically installed in GAC (Global Assembly Cache):
VS Toolbox:After installation, you should be able to find the following components in the Designer Toolbox of Visual Studio:
To ensure a successful installation of the Awesomium.NET components in Visual Studio’s Toolbox, Visual Studio must not be running during the installation of the Awesomium SDK. If you notice that the components are missing, you may have to uninstall and reinstall the SDK, after closing Visual Studio. Redistribution:To distribute the Awesomium and Awesomium.NET components used by your application, follow these steps:
Copying Awesomium.NET references in C# & VB.NET Next time you build your project, all Awesomium.NET assemblies including the necessary native Awesomium libraries, will be copied to your output directory. This is all you need to distribute your application. For more details about how to use Awesomium.NET in your applications, read: Getting Started with Awesomium.NET. Samples: The Windows installer of Awesomium SDK and Awesomium.NET, deploys an Awesomium.NET Samples solution under: %MyDocuments%\Visual Studio 2010\Projects\Awesomium.NET\1.6.4\Samples The solution includes the following samples, demonstrating uses of Awesomium.NET: Core:
WPF:
Windows Forms:
Codeplex: Our Codeplex project maintains updates to the Awesomium.NET Samples, redistributable Windows installer modules of Awesomium.NET, Utilities etc.. Licensing:Awesomium and Awesomium.NET are free for evaluation, non-commercial use, and independent use (by companies who made less than $100K in revenue last year). If you’re a larger company and would like to use Awesomium for commercial use, you can purchase a Pro License at https://awesomium.com/buy/ Conclusion:You’re only a few steps from embedding the Web in your .NET application! What are you waiting for?
Additional Resources:
|