i have one application running remotly and want to take its window snapshort
at any given time,
Here is a code i wrote

public Bitmap GetPicture()

{

Bitmap sbmp = new Bitmap(1000, 1000);

Graphics g = Graphics.FromImage( sbmp );

System.Windows.Forms.PaintEventArgs pe = new PaintEventArgs(g, new
Rectangle(0, 0, 1000, 1000));

this.InvokePaint(this.picturebox, pe);

g.Dispose();

return sbmp;

}



problem with this code is that it works fine with picture box, but if i
specify this (current form) or any user control or IE webBrowser control i
dont get any thing back its just blank.

requirment is that it should be able to get snapshot even window is
minimized (or even hidden).

Thanks,

Sajjad

Re: Taking Bitmap snapshot of a from or a control on a form by Atul

Atul
Mon Jul 18 21:27:40 CDT 2005

Try sending a WM_PRINT message to the control. If it supports the message,
it will print itself to the DC

Atul Godbole
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net

"Sajjad" <sa@nospam.nospam> wrote in message
news:O%23IfwBAjFHA.3912@TK2MSFTNGP10.phx.gbl...
>i have one application running remotly and want to take its window
>snapshort at any given time,
> Here is a code i wrote
>
> public Bitmap GetPicture()
>
> {
>
> Bitmap sbmp = new Bitmap(1000, 1000);
>
> Graphics g = Graphics.FromImage( sbmp );
>
> System.Windows.Forms.PaintEventArgs pe = new PaintEventArgs(g, new
> Rectangle(0, 0, 1000, 1000));
>
> this.InvokePaint(this.picturebox, pe);
>
> g.Dispose();
>
> return sbmp;
>
> }
>
>
>
> problem with this code is that it works fine with picture box, but if i
> specify this (current form) or any user control or IE webBrowser control
> i dont get any thing back its just blank.
>
> requirment is that it should be able to get snapshot even window is
> minimized (or even hidden).
>
> Thanks,
>
> Sajjad
>
>
>
>



Re: Taking Bitmap snapshot of a from or a control on a form by Sajjad

Sajjad
Tue Jul 19 19:25:34 CDT 2005

do you have idea how can i do it from within .net
"Atul Godbole" <atulatsswaredotcom> wrote in message
news:%23FxrlnAjFHA.3656@TK2MSFTNGP09.phx.gbl...
> Try sending a WM_PRINT message to the control. If it supports the
> message, it will print itself to the DC
>
> Atul Godbole
> http://www.ssware.com/
> Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net
>
> "Sajjad" <sa@nospam.nospam> wrote in message
> news:O%23IfwBAjFHA.3912@TK2MSFTNGP10.phx.gbl...
>>i have one application running remotly and want to take its window
>>snapshort at any given time,
>> Here is a code i wrote
>>
>> public Bitmap GetPicture()
>>
>> {
>>
>> Bitmap sbmp = new Bitmap(1000, 1000);
>>
>> Graphics g = Graphics.FromImage( sbmp );
>>
>> System.Windows.Forms.PaintEventArgs pe = new PaintEventArgs(g, new
>> Rectangle(0, 0, 1000, 1000));
>>
>> this.InvokePaint(this.picturebox, pe);
>>
>> g.Dispose();
>>
>> return sbmp;
>>
>> }
>>
>>
>>
>> problem with this code is that it works fine with picture box, but if i
>> specify this (current form) or any user control or IE webBrowser control
>> i dont get any thing back its just blank.
>>
>> requirment is that it should be able to get snapshot even window is
>> minimized (or even hidden).
>>
>> Thanks,
>>
>> Sajjad
>>
>>
>>
>>
>
>



Re: Taking Bitmap snapshot of a from or a control on a form by Atul

Atul
Wed Jul 20 02:21:01 CDT 2005

Use the SendMessage method. You will need to do P/Invoke by using the
DLLImport attribute.

-Atul
http://www.ssware.com/
Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net

"Sajjad" <sa@nospam.nospam> wrote in message
news:%236bYNGMjFHA.2920@TK2MSFTNGP14.phx.gbl...
> do you have idea how can i do it from within .net
> "Atul Godbole" <atulatsswaredotcom> wrote in message
> news:%23FxrlnAjFHA.3656@TK2MSFTNGP09.phx.gbl...
>> Try sending a WM_PRINT message to the control. If it supports the
>> message, it will print itself to the DC
>>
>> Atul Godbole
>> http://www.ssware.com/
>> Shell MegaPack - Windows Explorer Shell Controls for ActiveX and .Net
>>
>> "Sajjad" <sa@nospam.nospam> wrote in message
>> news:O%23IfwBAjFHA.3912@TK2MSFTNGP10.phx.gbl...
>>>i have one application running remotly and want to take its window
>>>snapshort at any given time,
>>> Here is a code i wrote
>>>
>>> public Bitmap GetPicture()
>>>
>>> {
>>>
>>> Bitmap sbmp = new Bitmap(1000, 1000);
>>>
>>> Graphics g = Graphics.FromImage( sbmp );
>>>
>>> System.Windows.Forms.PaintEventArgs pe = new PaintEventArgs(g, new
>>> Rectangle(0, 0, 1000, 1000));
>>>
>>> this.InvokePaint(this.picturebox, pe);
>>>
>>> g.Dispose();
>>>
>>> return sbmp;
>>>
>>> }
>>>
>>>
>>>
>>> problem with this code is that it works fine with picture box, but if i
>>> specify this (current form) or any user control or IE webBrowser
>>> control i dont get any thing back its just blank.
>>>
>>> requirment is that it should be able to get snapshot even window is
>>> minimized (or even hidden).
>>>
>>> Thanks,
>>>
>>> Sajjad
>>>
>>>
>>>
>>>
>>
>>
>
>



Re: Taking Bitmap snapshot of a from or a control on a form by v-jetan

v-jetan
Thu Jul 28 02:07:48 CDT 2005

Hi Sajjad,

Does my reply make sense to you? Is your problem resolved? Please feel free
to tell me, thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.