You can't create a bitmap from text. You have to use IE and the =
WebBrowser control it provides through
Interop in order to load some HTML and display it offscreen. Once the =
display is rendered you can get the
device context of the WebBrowser control and StretchBlt it to your =
thumbnail surface. Almost 100% of this
process is going to be though RCWs (runtime callable wrappers) and =
PInvoke. There is not a good managed
solution for this.
--=20
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers [quoted text, click to view] "Curtis Tammany" <ctammany@NO_SPAMegginc.com> wrote in message =
news:OADT03%237DHA.3380@tk2msftngp13.phx.gbl...
It would seem something like this would work:
Dim objWebClient as New WebClient()
Const strURL as String =3D "
http://www.cnn.com/" Dim HTMLStream as Stream =3D objWebClient.OpenRead(strURL)
dim imgOutput =3D New Bitmap(HTMLStream) =20
dim g as graphics =3D graphics.fromimage(imgOutput) ' create a New =
graphic object from the above bmp =20
response.contenttype=3D"image/gif" =20
imgOutput.save(response.outputstream, imageformat.gif) ' output to =
the user =20
g.dispose() =20
imgOutput.dispose()
HTMLStream.Close()
but I get an error creating the bitmap (invalid parameter used).
I think I'm close but not sure what I'm doing wrong.
Curtis
[quoted text, click to view] "Justin Rogers" <Justin@games4dotnet.com> wrote in message =
news:OgLjmtQ7DHA.1632@TK2MSFTNGP12.phx.gbl...
This is going to be far harder than you might think. I'd first =
investigate third party libraries that do this. Then if you don't find =
anything you'd like:
1. Learn how to use the WebBrowser control.
2. With the document loaded into the WebBrowser control get the DC =
or device context
3. Create an offscreen surface of the thumbnailed size.
4. Call StretchBlt to go from the WebBrowser DC to the thumbnail =
surface.
--=20
Justin Rogers
DigiTec Web Consultants, LLC.
Blog:
http://weblogs.asp.net/justin_rogers [quoted text, click to view] "Curtis Tammany" <ctammany@NO_SPAMegginc.com> wrote in message =
news:OJe8lCC7DHA.2644@TK2MSFTNGP11.phx.gbl...
Hi-
Does anyone know how to take a screen scrape of a web page and =
convert it to a thumbnail image?=20
I don't know where to start.
Thanks in advance,