Last post Oct 01, 2010 10:36 AM by Nilla2010
Jan 24, 2008 10:05 AM|seco|LINK
i want to draw a part of the page like panel or table or whatever to image
how to convert it to stream to save it to image?
thanks in advance.
Jan 24, 2008 10:37 AM|ColinWhitlatch|LINK
There are basically two options:
1) Capture the entire html page after it's rendered and then crop out what you're looking for
2) Render the html directly to an image, and crop out what you're looking for
There isn't a way to get just a particular html element to render directly to an image. You'll have to pick either option and then manually remove what you want, or calculate where the piece you want is and remove it through GDI.
If you want to go the route of capturing just the image, you can use one of the many tools that are made specifically for doing so ( html2jpg is one ). There used to be a few free ones laying around, but i couldn't find them in a quick search.
If you want to go the route of doing the rendering yourself, you can use the shdocvw dll and render into your own graphic context. It's pretty complex stuff, but if you're determined enough you can get something functional that runs in the managed world.
Here's a few links for option #2 from codeproject:
C# capturing of IE using shdocvw:
Native C++ capturing of IE using shdocvw:
Hope this helps!
Jan 24, 2008 12:32 PM|seco|LINK
thanks for reply
you mention a tool called html2jpg and this is a program how can i use it on the server that i will upload the site to? do you mean i will execute it?
there was a solution for that and it was to capture the byte array of the element and save it as image and this on the server side control event i don't remember what the event was
any way if any one knows what i mean i need help
Jan 25, 2008 01:36 PM|seco|LINK
Jan 27, 2008 06:59 AM|seco|LINK
im asking if there any asp.net third party component that convert server controls to image
Oct 01, 2010 10:36 AM|Nilla2010|LINK
@seco I am in the same situation and trying to achieve the same.Please share the code .