|
| 1 | +# Welcome to the HTML Renderer WPF library! |
| 2 | + |
| 3 | +This library provides the rich formatting power of HTML in your WPF .NET applications using |
| 4 | +simple controls or static rendering code. |
| 5 | +For more info see HTML Renderer on GitHub: https://github.com/ArthurHub/HTML-Renderer |
| 6 | + |
| 7 | +## DEMO APPLICATION |
| 8 | + |
| 9 | +HTML Renderer Demo application showcases HTML Renderer capabilities, use it to explore and learn |
| 10 | +on the library: https://codeplexarchive.org/ProjectTab/Wiki/HtmlRenderer/Documentation/Demo%20application |
| 11 | + |
| 12 | +## FEEDBACK / RELEASE NOTES |
| 13 | + |
| 14 | +If you have problems, wish to report a bug, or have a suggestion, please open an issue on the |
| 15 | +HTML Renderer issue page: https://github.com/ArthurHub/HTML-Renderer/issues |
| 16 | + |
| 17 | +For full release notes and all versions see: https://github.com/ArthurHub/HTML-Renderer/releases |
| 18 | + |
| 19 | +## QUICK START |
| 20 | + |
| 21 | +For more Quick Start see: https://codeplexarchive.org/ProjectTab/Wiki/HtmlRenderer/Documentation/Documentation |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Quick Start: Use HTML panel control on WPF window |
| 26 | + |
| 27 | +```xaml |
| 28 | +<Window x:Class="Window1" |
| 29 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 30 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 31 | + Title="Window1" Height="300" Width="300" |
| 32 | + xmlns:wpf="clr-namespace:TheArtOfDev.HtmlRenderer.WPF;assembly=HtmlRenderer.WPF"> |
| 33 | + <Grid> |
| 34 | + <wpf:HtmlPanel Text="<p> <h1> Hello World </h1> This is html rendered text</p>"/> |
| 35 | + </Grid> |
| 36 | +</Window> |
| 37 | +``` |
| 38 | + |
| 39 | +## Quick Start: Create image from HTML snippet |
| 40 | + |
| 41 | +```csharp |
| 42 | +class Program |
| 43 | +{ |
| 44 | + private static void Main(string[] args) |
| 45 | + { |
| 46 | + BitmapFrame image = HtmlRender.RenderToImage("<p><h1>Hello World</h1>This is html rendered text</p>"); |
| 47 | + var encoder = new PngBitmapEncoder(); |
| 48 | + encoder.Frames.Add(image); |
| 49 | + using (FileStream stream = new FileStream("image.png", FileMode.OpenOrCreate)) |
| 50 | + encoder.Save(stream); |
| 51 | + } |
| 52 | +} |
| 53 | +``` |
0 commit comments