IMHOTEP Framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
HTMLTest.cs
1 using UnityEngine;
2 using System.Collections;
3 using System;
4 using System.IO;
5 
6 public class HTMLTest : MonoBehaviour {
7 
8  // Use this for initialization
9  void Start () {
10  loadHTML();
11  }
12 
13  private void loadHTML()
14  {
15  //string html = "<h1> Hello World </h1><p style=\"color:white; background-color:red\"> This is html rendered text</p>";
16 
17  // Open the file to read from.
18  string html = File.ReadAllText("IMHOTEP.html");
19 
20  System.Drawing.Image image = TheArtOfDev.HtmlRenderer.WinForms.HtmlRender.RenderToImageGdiPlus(html, new System.Drawing.Size(825, 1200));//, System.Drawing.Text.TextRenderingHint.AntiAliasGridFit);
21  image.Save("image.png", System.Drawing.Imaging.ImageFormat.Png);
22  }
23 
24  // Update is called once per frame
25  void Update () {
26 
27  }
28 }