473,722 Members | 2,325 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Thumbnail of WebBrowser content

Hi,

I would like to make thumbnails of web page by capture content of a
WebBrowser. By example, capture http://www.google.com.

I used WebBrowser control with Framework 2.0.

I try this :

*************** *************** *************** ****
WebBrowser w = (WebBrowser)sen der;

Rectangle rec = w.Bounds;

Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);

w.BringToFront( );

w.DrawToBitmap( bitm, rec);

picScreenshot.I mage = bitm;

bitm.Save(@"c:\ temp.jpg");

bitm.Dispose();

*************** *************** *************** ****
But it doesn't work (DrawToBimap seems to be not managed by the WebBrowser
control).

How can I do to make these kind of thumbnails ?

A+
Mar 29 '06 #1
8 3416
Dnia 29-03-2006 o 19:18:40 Prosperz <pr************ ***@hotmail.com >
napisa³:
Hi,

I would like to make thumbnails of web page by capture content of a
WebBrowser. By example, capture http://www.google.com.

I used WebBrowser control with Framework 2.0.

I try this :

*************** *************** *************** ****
WebBrowser w = (WebBrowser)sen der;

Rectangle rec = w.Bounds;

Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);

w.BringToFront( );

w.DrawToBitmap( bitm, rec);

picScreenshot.I mage = bitm;

bitm.Save(@"c:\ temp.jpg");

bitm.Dispose();

*************** *************** *************** ****
But it doesn't work (DrawToBimap seems to be not managed by the
WebBrowser
control).

How can I do to make these kind of thumbnails ?

[PD] Theoretically you can try to play with WM_PRINT or WM_PRINTCLIENT
message (create HDC and send it as a param of a message an then copy it to
the graphics). I have done that with some controls and it works,
unfortunately I don't have any sample code now. The second, much simpler
but also a little bit less elegant idea is to do it this way:
destinationGrap hics.CopyFromSc reen(
webBrowser.Poin tToScreen(new Point(0, 0)),
new Point(0, 0), webBrowser.Size );

Of course your control must be fully visible - if any window will cover it
the capture will be corupt.

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com
Mar 29 '06 #2
I never used WM_PRINT and I don't know how to use it. Can you be more
precise ?

I would like to precise that I want to make a screenshot of an entire web
page even if only a part is visible in the WebBrowser...

Maybe I must not use WebBroser to do that.

"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 29-03-2006 o 19:18:40 Prosperz <pr************ ***@hotmail.com >
napisa³:
Hi,

I would like to make thumbnails of web page by capture content of a
WebBrowser. By example, capture http://www.google.com.

I used WebBrowser control with Framework 2.0.

I try this :

*************** *************** *************** ****
WebBrowser w = (WebBrowser)sen der;

Rectangle rec = w.Bounds;

Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);

w.BringToFront( );

w.DrawToBitmap( bitm, rec);

picScreenshot.I mage = bitm;

bitm.Save(@"c:\ temp.jpg");

bitm.Dispose();

*************** *************** *************** ****
But it doesn't work (DrawToBimap seems to be not managed by the
WebBrowser
control).

How can I do to make these kind of thumbnails ?

[PD] Theoretically you can try to play with WM_PRINT or WM_PRINTCLIENT
message (create HDC and send it as a param of a message an then copy it to
the graphics). I have done that with some controls and it works,
unfortunately I don't have any sample code now. The second, much simpler
but also a little bit less elegant idea is to do it this way:
destinationGrap hics.CopyFromSc reen(
webBrowser.Poin tToScreen(new Point(0, 0)),
new Point(0, 0), webBrowser.Size );

Of course your control must be fully visible - if any window will cover it
the capture will be corupt.

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com

Mar 29 '06 #3
Dnia 29-03-2006 o 20:32:46 Prosperz <pr************ ***@hotmail.com >
napisał:
I never used WM_PRINT and I don't know how to use it. Can you be more
precise ?

I would like to precise that I want to make a screenshot of an entire web
page even if only a part is visible in the WebBrowser...

Maybe I must not use WebBroser to do that.

"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 29-03-2006 o 19:18:40 Prosperz <pr************ ***@hotmail.com >
napisa³:
Hi,

I would like to make thumbnails of web page by capture content of a
WebBrowser. By example, capture http://www.google.com.

I used WebBrowser control with Framework 2.0.

I try this :

*************** *************** *************** ****
WebBrowser w = (WebBrowser)sen der;

Rectangle rec = w.Bounds;

Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);

w.BringToFront( );

w.DrawToBitmap( bitm, rec);

picScreenshot.I mage = bitm;

bitm.Save(@"c:\ temp.jpg");

bitm.Dispose();

*************** *************** *************** ****
But it doesn't work (DrawToBimap seems to be not managed by the
WebBrowser
control).

How can I do to make these kind of thumbnails ?

[PD] Theoretically you can try to play with WM_PRINT or WM_PRINTCLIENT
message (create HDC and send it as a param of a message an then copy it
to
the graphics). I have done that with some controls and it works,
unfortunately I don't have any sample code now. The second, much simpler
but also a little bit less elegant idea is to do it this way:
destinationGrap hics.CopyFromSc reen(
webBrowser.Poin tToScreen(new Point(0, 0)),
new Point(0, 0), webBrowser.Size );

Of course your control must be fully visible - if any window will cover
it
the capture will be corupt.

[PD] WM_PRINT is a windows message - you can send it to a window to ask it
to draw it's contents on the provided device context (hdc). You can create
hdc (i.e. by calling GetHdc of your Graphics class instance) and pass it
as a parameter to SendMessage, so that window will draw on your graphics.
Look hier for sample code (I have just found it so don't know if it works
but looks ok):
http://tommycarlier.blogspot.com/200...cs-object.html

I'm not sure if this solution is good for your problem - probably there
are better ways to do that - look at this article, it looks valuable:
http://www.developerfusion.co.uk/show/4712/

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com
Mar 29 '06 #4
More generally, is there an opensource control that made this functionality
?

I found : websnapshot and dypswebcapture but you must paid to use them.

Any tools ?
"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 29-03-2006 o 20:32:46 Prosperz <pr************ ***@hotmail.com >
napisal:
I never used WM_PRINT and I don't know how to use it. Can you be more
precise ?

I would like to precise that I want to make a screenshot of an entire web
page even if only a part is visible in the WebBrowser...

Maybe I must not use WebBroser to do that.

"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 29-03-2006 o 19:18:40 Prosperz <pr************ ***@hotmail.com >
napisa³:

Hi,

I would like to make thumbnails of web page by capture content of a
WebBrowser. By example, capture http://www.google.com.

I used WebBrowser control with Framework 2.0.

I try this :

*************** *************** *************** ****
WebBrowser w = (WebBrowser)sen der;

Rectangle rec = w.Bounds;

Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);

w.BringToFront( );

w.DrawToBitmap( bitm, rec);

picScreenshot.I mage = bitm;

bitm.Save(@"c:\ temp.jpg");

bitm.Dispose();

*************** *************** *************** ****
But it doesn't work (DrawToBimap seems to be not managed by the
WebBrowser
control).

How can I do to make these kind of thumbnails ?

[PD] Theoretically you can try to play with WM_PRINT or WM_PRINTCLIENT
message (create HDC and send it as a param of a message an then copy it
to
the graphics). I have done that with some controls and it works,
unfortunately I don't have any sample code now. The second, much simpler
but also a little bit less elegant idea is to do it this way:
destinationGrap hics.CopyFromSc reen(
webBrowser.Poin tToScreen(new Point(0, 0)),
new Point(0, 0), webBrowser.Size );

Of course your control must be fully visible - if any window will cover
it
the capture will be corupt.

[PD] WM_PRINT is a windows message - you can send it to a window to ask it
to draw it's contents on the provided device context (hdc). You can create
hdc (i.e. by calling GetHdc of your Graphics class instance) and pass it
as a parameter to SendMessage, so that window will draw on your graphics.
Look hier for sample code (I have just found it so don't know if it works
but looks ok):
http://tommycarlier.blogspot.com/200...cs-object.html

I'm not sure if this solution is good for your problem - probably there
are better ways to do that - look at this article, it looks valuable:
http://www.developerfusion.co.uk/show/4712/

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com

Mar 29 '06 #5
I try the two methods, but it doesn't give me entire satisfaction.

I really would like to reproduce behavior of DrawToBitmap for a WebBrowser
Control...

How can I do that ?
"Prosperz" <pr************ ***@hotmail.com > a écrit dans le message de news:
44************* *********@news. free.fr...
More generally, is there an opensource control that made this
functionality ?

I found : websnapshot and dypswebcapture but you must paid to use them.

Any tools ?
"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 29-03-2006 o 20:32:46 Prosperz <pr************ ***@hotmail.com >
napisal:
I never used WM_PRINT and I don't know how to use it. Can you be more
precise ?

I would like to precise that I want to make a screenshot of an entire
web
page even if only a part is visible in the WebBrowser...

Maybe I must not use WebBroser to do that.

"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 29-03-2006 o 19:18:40 Prosperz <pr************ ***@hotmail.com >
napisa³:

> Hi,
>
> I would like to make thumbnails of web page by capture content of a
> WebBrowser. By example, capture http://www.google.com.
>
> I used WebBrowser control with Framework 2.0.
>
> I try this :
>
> *************** *************** *************** ****
> WebBrowser w = (WebBrowser)sen der;
>
> Rectangle rec = w.Bounds;
>
> Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);
>
> w.BringToFront( );
>
> w.DrawToBitmap( bitm, rec);
>
> picScreenshot.I mage = bitm;
>
> bitm.Save(@"c:\ temp.jpg");
>
> bitm.Dispose();
>
> *************** *************** *************** ****
>
>
> But it doesn't work (DrawToBimap seems to be not managed by the
> WebBrowser
> control).
>
> How can I do to make these kind of thumbnails ?
>
[PD] Theoretically you can try to play with WM_PRINT or WM_PRINTCLIENT
message (create HDC and send it as a param of a message an then copy it
to
the graphics). I have done that with some controls and it works,
unfortunately I don't have any sample code now. The second, much
simpler
but also a little bit less elegant idea is to do it this way:
destinationGrap hics.CopyFromSc reen(
webBrowser.Poin tToScreen(new Point(0, 0)),
new Point(0, 0), webBrowser.Size );

Of course your control must be fully visible - if any window will cover
it
the capture will be corupt.

[PD] WM_PRINT is a windows message - you can send it to a window to ask
it to draw it's contents on the provided device context (hdc). You can
create hdc (i.e. by calling GetHdc of your Graphics class instance) and
pass it as a parameter to SendMessage, so that window will draw on your
graphics. Look hier for sample code (I have just found it so don't know
if it works but looks ok):
http://tommycarlier.blogspot.com/200...cs-object.html

I'm not sure if this solution is good for your problem - probably there
are better ways to do that - look at this article, it looks valuable:
http://www.developerfusion.co.uk/show/4712/

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com


Mar 30 '06 #6
Dnia 30-03-2006 o 08:01:33 Prosperz <pr************ ***@hotmail.com >
napisał:
I try the two methods, but it doesn't give me entire satisfaction.

I really would like to reproduce behavior of DrawToBitmap for a
WebBrowser
Control...

How can I do that ?
"Prosperz" <pr************ ***@hotmail.com > a écrit dans le message de
news:
44************* *********@news. free.fr...
More generally, is there an opensource control that made this
functionality ?

I found : websnapshot and dypswebcapture but you must paid to use them.

Any tools ?
"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 29-03-2006 o 20:32:46 Prosperz <pr************ ***@hotmail.com >
napisal:

I never used WM_PRINT and I don't know how to use it. Can you be more
precise ?

I would like to precise that I want to make a screenshot of an entire
web
page even if only a part is visible in the WebBrowser...

Maybe I must not use WebBroser to do that.

"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans
le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
> Dnia 29-03-2006 o 19:18:40 Prosperz <pr************ ***@hotmail.com >
> napisa³:
>
>> Hi,
>>
>> I would like to make thumbnails of web page by capture content of a
>> WebBrowser. By example, capture http://www.google.com.
>>
>> I used WebBrowser control with Framework 2.0.
>>
>> I try this :
>>
>> *************** *************** *************** ****
>> WebBrowser w = (WebBrowser)sen der;
>>
>> Rectangle rec = w.Bounds;
>>
>> Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);
>>
>> w.BringToFront( );
>>
>> w.DrawToBitmap( bitm, rec);
>>
>> picScreenshot.I mage = bitm;
>>
>> bitm.Save(@"c:\ temp.jpg");
>>
>> bitm.Dispose();
>>
>> *************** *************** *************** ****
>>
>>
>> But it doesn't work (DrawToBimap seems to be not managed by the
>> WebBrowser
>> control).
>>
>> How can I do to make these kind of thumbnails ?
>>
> [PD] Theoretically you can try to play with WM_PRINT or
> WM_PRINTCLIENT
> message (create HDC and send it as a param of a message an then copy
> it
> to
> the graphics). I have done that with some controls and it works,
> unfortunately I don't have any sample code now. The second, much
> simpler
> but also a little bit less elegant idea is to do it this way:
> destinationGrap hics.CopyFromSc reen(
> webBrowser.Poin tToScreen(new Point(0, 0)),
> new Point(0, 0), webBrowser.Size );
>
> Of course your control must be fully visible - if any window will
> cover
> it
> the capture will be corupt.
>
[PD] WM_PRINT is a windows message - you can send it to a window to ask
it to draw it's contents on the provided device context (hdc). You can
create hdc (i.e. by calling GetHdc of your Graphics class instance) and
pass it as a parameter to SendMessage, so that window will draw on your
graphics. Look hier for sample code (I have just found it so don't know
if it works but looks ok):
http://tommycarlier.blogspot.com/200...cs-object.html

I'm not sure if this solution is good for your problem - probably there
are better ways to do that - look at this article, it looks valuable:
http://www.developerfusion.co.uk/show/4712/


[PD] Can you describe what problems do you have with solutions I have
posted above? The second one looks like it should work (I haven't tested
it but the code looks OK).

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com
Mar 30 '06 #7
The second method generate an cast exception on IHTMLElementRen der render =
(IHTMLElementRe nder) element;
Moreover, it is not based on WebBrowser Control within framework 2.0.

The first method doesn't work. It seems WebBrowser doesn't managed
WM_PRINT...

"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 30-03-2006 o 08:01:33 Prosperz <pr************ ***@hotmail.com >
napisal:
I try the two methods, but it doesn't give me entire satisfaction.

I really would like to reproduce behavior of DrawToBitmap for a
WebBrowser
Control...

How can I do that ?
"Prosperz" <pr************ ***@hotmail.com > a écrit dans le message de
news:
44************* *********@news. free.fr...
More generally, is there an opensource control that made this
functionality ?

I found : websnapshot and dypswebcapture but you must paid to use them.

Any tools ?
"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 29-03-2006 o 20:32:46 Prosperz <pr************ ***@hotmail.com >
napisal:

> I never used WM_PRINT and I don't know how to use it. Can you be more
> precise ?
>
> I would like to precise that I want to make a screenshot of an entire
> web
> page even if only a part is visible in the WebBrowser...
>
> Maybe I must not use WebBroser to do that.
>
> "Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans
> le
> message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
>> Dnia 29-03-2006 o 19:18:40 Prosperz <pr************ ***@hotmail.com >
>> napisa³:
>>
>>> Hi,
>>>
>>> I would like to make thumbnails of web page by capture content of a
>>> WebBrowser. By example, capture http://www.google.com.
>>>
>>> I used WebBrowser control with Framework 2.0.
>>>
>>> I try this :
>>>
>>> *************** *************** *************** ****
>>> WebBrowser w = (WebBrowser)sen der;
>>>
>>> Rectangle rec = w.Bounds;
>>>
>>> Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);
>>>
>>> w.BringToFront( );
>>>
>>> w.DrawToBitmap( bitm, rec);
>>>
>>> picScreenshot.I mage = bitm;
>>>
>>> bitm.Save(@"c:\ temp.jpg");
>>>
>>> bitm.Dispose();
>>>
>>> *************** *************** *************** ****
>>>
>>>
>>> But it doesn't work (DrawToBimap seems to be not managed by the
>>> WebBrowser
>>> control).
>>>
>>> How can I do to make these kind of thumbnails ?
>>>
>> [PD] Theoretically you can try to play with WM_PRINT or
>> WM_PRINTCLIENT
>> message (create HDC and send it as a param of a message an then copy
>> it
>> to
>> the graphics). I have done that with some controls and it works,
>> unfortunately I don't have any sample code now. The second, much
>> simpler
>> but also a little bit less elegant idea is to do it this way:
>> destinationGrap hics.CopyFromSc reen(
>> webBrowser.Poin tToScreen(new Point(0, 0)),
>> new Point(0, 0), webBrowser.Size );
>>
>> Of course your control must be fully visible - if any window will
>> cover
>> it
>> the capture will be corupt.
>>
[PD] WM_PRINT is a windows message - you can send it to a window to ask
it to draw it's contents on the provided device context (hdc). You can
create hdc (i.e. by calling GetHdc of your Graphics class instance) and
pass it as a parameter to SendMessage, so that window will draw on your
graphics. Look hier for sample code (I have just found it so don't know
if it works but looks ok):
http://tommycarlier.blogspot.com/200...cs-object.html

I'm not sure if this solution is good for your problem - probably there
are better ways to do that - look at this article, it looks valuable:
http://www.developerfusion.co.uk/show/4712/


[PD] Can you describe what problems do you have with solutions I have
posted above? The second one looks like it should work (I haven't tested
it but the code looks OK).

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com

Mar 30 '06 #8
Dnia 30-03-2006 o 19:26:00 Prosperz <pr************ ***@hotmail.com >
napisał:
The second method generate an cast exception on IHTMLElementRen der
render =
(IHTMLElementRe nder) element;
Moreover, it is not based on WebBrowser Control within framework 2.0.
[PD] Yes, this solution is based on ActiveX browser control. But you can
also access unmanaged interfaces of document using
webBrowser.Docu ment.DomDocumen t property. You can cast it to
IHTMLDocument2 just like in this article and move on.

The first method doesn't work. It seems WebBrowser doesn't managed
WM_PRINT...

"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
Dnia 30-03-2006 o 08:01:33 Prosperz <pr************ ***@hotmail.com >
napisal:
I try the two methods, but it doesn't give me entire satisfaction.

I really would like to reproduce behavior of DrawToBitmap for a
WebBrowser
Control...

How can I do that ?
"Prosperz" <pr************ ***@hotmail.com > a écrit dans le message de
news:
44************* *********@news. free.fr...
More generally, is there an opensource control that made this
functionality ?

I found : websnapshot and dypswebcapture but you must paid to use
them.

Any tools ?
"Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans
le
message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
> Dnia 29-03-2006 o 20:32:46 Prosperz <pr************ ***@hotmail.com >
> napisal:
>
>> I never used WM_PRINT and I don't know how to use it. Can you be
>> more
>> precise ?
>>
>> I would like to precise that I want to make a screenshot of an
>> entire
>> web
>> page even if only a part is visible in the WebBrowser...
>>
>> Maybe I must not use WebBroser to do that.
>>
>> "Piotr Dobrowolski" <Piotr.Dobrowol ski@_usun_gmail .com> a écrit dans
>> le
>> message de news: op************* **@da-pdobrowolski.wi ndtelecom.pl...
>>> Dnia 29-03-2006 o 19:18:40 Prosperz <pr************ ***@hotmail.com >
>>> napisa³:
>>>
>>>> Hi,
>>>>
>>>> I would like to make thumbnails of web page by capture content of
>>>> a
>>>> WebBrowser. By example, capture http://www.google.com.
>>>>
>>>> I used WebBrowser control with Framework 2.0.
>>>>
>>>> I try this :
>>>>
>>>> *************** *************** *************** ****
>>>> WebBrowser w = (WebBrowser)sen der;
>>>>
>>>> Rectangle rec = w.Bounds;
>>>>
>>>> Bitmap bitm = new Bitmap(rec.Widt h, rec.Height);
>>>>
>>>> w.BringToFront( );
>>>>
>>>> w.DrawToBitmap( bitm, rec);
>>>>
>>>> picScreenshot.I mage = bitm;
>>>>
>>>> bitm.Save(@"c:\ temp.jpg");
>>>>
>>>> bitm.Dispose();
>>>>
>>>> *************** *************** *************** ****
>>>>
>>>>
>>>> But it doesn't work (DrawToBimap seems to be not managed by the
>>>> WebBrowser
>>>> control).
>>>>
>>>> How can I do to make these kind of thumbnails ?
>>>>
>>> [PD] Theoretically you can try to play with WM_PRINT or
>>> WM_PRINTCLIENT
>>> message (create HDC and send it as a param of a message an then
>>> copy
>>> it
>>> to
>>> the graphics). I have done that with some controls and it works,
>>> unfortunately I don't have any sample code now. The second, much
>>> simpler
>>> but also a little bit less elegant idea is to do it this way:
>>> destinationGrap hics.CopyFromSc reen(
>>> webBrowser.Poin tToScreen(new Point(0, 0)),
>>> new Point(0, 0), webBrowser.Size );
>>>
>>> Of course your control must be fully visible - if any window will
>>> cover
>>> it
>>> the capture will be corupt.
>>>
> [PD] WM_PRINT is a windows message - you can send it to a window to
> ask
> it to draw it's contents on the provided device context (hdc). You
> can
> create hdc (i.e. by calling GetHdc of your Graphics class instance)
> and
> pass it as a parameter to SendMessage, so that window will draw on
> your
> graphics. Look hier for sample code (I have just found it so don't
> know
> if it works but looks ok):
> http://tommycarlier.blogspot.com/200...cs-object.html
>
> I'm not sure if this solution is good for your problem - probably
> there
> are better ways to do that - look at this article, it looks valuable:
> http://www.developerfusion.co.uk/show/4712/
>


[PD] Can you describe what problems do you have with solutions I have
posted above? The second one looks like it should work (I haven't tested
it but the code looks OK).

--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com



--
Piotr Dobrowolski
Piotr.Dobrowols ki@_usun_gmail. com
Apr 1 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5611
by: Mike | last post by:
Sites using thumbnail preview for world wide web file navigation and searching. Below are list of sites that are either researching or providing thumbnail preview images for online web documents. Thumbnail previews are useful for web site navigation particularly in search engines and directories such as Google, Altavista and Yahoo. The preview images provide a portion of the content of the electronic file to aid in navigation.
54
7231
by: Max Quordlepleen | last post by:
Apologies for the crossposting, I wasn't sure which of these groups to ask this in. I have been lurking in these groups for a week or so, trying to glean what I need to design a simple, clean set of pages that get the w3c tick for XHTML 1.0 Strict, and CSS2. So far, I have succeeded, thanks to the great information in these groups. Now, however, I'm having trouble. A few days ago, I read a thread that dealt with this issue of...
1
1452
by: Johnny | last post by:
Hello, I am looking for someone to guide me in the right direction. What I want to do is take a "screenshot" of a web page programatically as IE sees it, using C#? I had previosuly used the Thumbnail Generator Web Service made by the GotDotNet folks but that doesnt seem to run successfully in Windows 2003, I think it only runs on Windows 2000.
5
2893
by: ask josephsen | last post by:
Hi NewsGroup Hope you can help me with this. I'm using the "System.Windows.Forms.WebBrowser" to display a various markuplanguage. And it works fine pointing the "WebBrowser.Url" to a local or remote uri. But what I would actually like to do, is to download a webpage as a string, analyze it, possibly modify it, and then display it on the WebBrowser - without asking the WebBrowser to download it again. By the "HttpWebRequest" I can easily...
0
1357
by: daveW | last post by:
Hi, I've been messing around with a personal website for a while now, and having totally bust my leg skiing have been google-wacking to work out how to use these funky stylesheet things. After the inevitable frustration to start with, I have something that seems to work ok and I have to say on the whole I like it. I've got a couple of oddities though, which if I can get them fixed would make it all look that little bit less 'hacky'...
12
6374
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
0
1303
by: Ben | last post by:
Hi all, I am trying to write a little app that will generate a thumbnail image of a website. Having searched the web I have found various bits of code that appear to do the job and have written my app which works but only sometimes! :( The problem is - sometimes it returns a black image instead of the nice screen shot. For example it sometimes works on the msn web site, never works with the google web site and sometimes does not work...
1
2142
by: John Henckel | last post by:
This is the simplest, quickest, dirtiest, leanest, meanest, thumbnail/slideshow image viewer PHP script I have ever seen. Enjoy, John --------- CUT HERE ------------------- <?php
4
13357
by: Robson Siqueira | last post by:
Folks, I am facing a problem. I am trying to manipulate the HTML data (thru the Document and DocumentText properties) of the WebBrowser object (System.Windows.Forms). The problem is that the application enters in a loop state and my changes don't apply. Have somebody faced the same problem? Any solutions?
0
8860
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9382
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9087
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4762
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3207
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2601
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.