Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic display a html page in winform (Read 4465 times)
parapara
YaBB Newbies
*
Offline


susan

Posts: 20
Location: China
Joined: Apr 3rd, 2008
display a html page in winform
Sep 5th, 2008 at 7:29am
Print Post  
this is the code of in winform:
[code]
Page page = new Page();
DiagramView dv = new DiagramView();
page.Controls.Add(dv);
dv.ClientSideMode = ClientSideMode.ImageMap;
dv.Width = new Unit(400, UnitType.Pixel);
dv.Height = new Unit(300, UnitType.Pixel);
dv.Style.Add("border", "solid 1px gray");

Diagram diagram = dv.Diagram;
diagram.LoadFromXml("c:\\Diagram.xml");
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
dv.RenderControl(htw);

[/code]

the value of HtmlTextWriter:
[code]
<div style="height:300px;width:400px;border:solid 1px gray;">

<table cellpadding='0' cellspacing='0' width='680px' height='529px' cols='1px'><tbody>

<tr height='0px'>
</div>
[/code]


the result is wrong.


I want to create a html of Diagram,and display it in winform with the control of System.Windows.Forms.WebBrowser.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: display a html page in winform
Reply #1 - Sep 5th, 2008 at 10:05am
Print Post  
Hi,

The HTML rendered by DiagramView.Render relies on ImageGen.aspx to generate the image bytes, so it's of not much use if you want to display the diagram as a static page without running a web server. Try the HtmlBuilder.CreateImageHtml method instead.

Stoyan
  
Back to top
 
IP Logged
 
parapara
YaBB Newbies
*
Offline


susan

Posts: 20
Location: China
Joined: Apr 3rd, 2008
Re: display a html page in winform
Reply #2 - Sep 8th, 2008 at 3:04am
Print Post  
well

I tried this method,another problem emerged.
if i set Cell.HyperLink,the result of HtmlBuilder.CreateImageMap is null.

[code]
Diagram d = this.DiagramView1.Diagram;
TableNode tn = d.Factory.CreateTableNode(10, 10, 30, 30,2,2);
tn[0, 0].Text = "links";
tn[0, 0].HyperLink = "http://mindfusion.org";

HtmlBuilder hb = new HtmlBuilder(d);
string imagemap = hb.CreateImageMap("maps");
[/code]
the content of imagemap do not include Cell.HyperLink.

imagemap:[code]

<MAP NAME='maps'>

</MAP>
[/code]
  
Back to top
 
IP Logged
 
parapara
YaBB Newbies
*
Offline


susan

Posts: 20
Location: China
Joined: Apr 3rd, 2008
Re: display a html page in winform
Reply #3 - Sep 8th, 2008 at 7:30am
Print Post  
The problem has been resolved,thanks! :)
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: display a html page in winform
Reply #4 - Sep 8th, 2008 at 8:05am
Print Post  
8)
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint