image from a web control

  • Thread starter Thread starter WebBuilder451
  • Start date Start date
W

WebBuilder451

is it possible to create an image from a web control. Given something simple
like a label control with text that may include html mark up language. Can a
bitmap object then be created to accept the control and then save it out as a
gif or a jpg?
 
Nope.
Webcontrol are not object that have a visible representation.
All they do is generate HTML.
Browser is responsible for rendering an HTML and has no idea how this HTML
was generated using ASP or PERL or WebControls...

Usually the way screenshots are captured is using 'print' capabilities of
the browser and special print driver that "prints" into image.
for example IE will print HTML page using command line

rundll32.exe %windir%\system32\mshtml.dll,PrintHTML "myfile.htm"

George.
 
You can create an image quite happily using the system.drawing namespace,
its fairly easy to have a base image and then add text to that image. You
could generate the image on the postback and stream it to the browser.

Creating an image from html would be harder. You'd have to take a screen
grab and then cut out the bit of the image you want I guess. It'd also have
to be done client side, which means getting into the realms of active x
controls and the like.

Can you give a more specific example of whatit is you're trying to do?

Cheers,

Tim.
 
this could work using rundll32.exe %windir%\system32\mshtml.dll,PrintHTML
"myfile.htm"
 
Back
Top