I have a html text box control in which I have embedded certain text and image. I would like to construct an image for the entire control with its content (eg - text, image).
Edit:
This is a wpf application.Actually on higher level , I am trying to construct a customizned printpreview page. For printPreview , I construct a Flowdocument. The flowdocument contains table. Table contains row and cell. this cell contains textblockcontainer or uiblockcontainer ( of wpf control)
Now for printing the wpf form, I go through each control (eg textbox, label etc..), get the text of it and place the text inside the tablecell of the table ( to be placed inside the flowdocument). If the wpf form contains a picture box, I get the image of it, place inside uiblockcontainer , add it to table cell , to be ultimately added to table and place it inside the flowdocument.
This was working fine for all images and controls in wpf form. Also the flowdocument was getting generated appropriately.
But I stumbled upon a form which contained html textbox control. This html text box control can contain html content which may have text and image both.
I can get access to html content of this htmltext box, how will I construct a image out of it. Eg of inner html is -
Test123 <xyz alt="testimg" src="C:\\Sample.img"> TestEnds
,xyz
is to be replaced byimg
. At run time , the html text box control replaces the aboveimg
tag with actual Image. So how to construct image for entire inner html above?From htmlTextbox content , we have exposed certain methods and extended it , and we also expose web browser control which has all standard properties of web browser control. I was hoping if I can construct an image and use it to place as image within table of flowdocument. Eg -
Control.DrawBitMap()
, but I dont see any such method for htmltextbox / web browser control. Can you please help?
Strangley, when I tried to use Control.DrawBitMap()
on htmltext box, It didn't generate the image for the entire content inside the control, but only generated the toolbar for html as image.
Also any other suggestion will help. Thanks.