Board index » cppbuilder » How to make screen copy including video streaming

How to make screen copy including video streaming

Hi,

Is there a way to capture a part of a screen including the image of
a video previewer (another app) ?

Thanks

        Tom

 

Re:How to make screen copy including video streaming


Hi Thomas,
If this other app is using overlay it's not possible (well, at least I
don't know of any way to do this).

Michael Liedlgruber

Thomas Estier schrieb:

Quote
> Hi,

> Is there a way to capture a part of a screen including the image of
> a video previewer (another app) ?

> Thanks

>         Tom

Re:How to make screen copy including video streaming


Hi Michael,

Yes it was using overlay.

But recently the problem changed : I succeeded to incorporate the
video stream in my main form without overlay.

So now, I just need to make a capture of the main form.
Know how to do this ?

Thanks

Tom

PS As I didn't see your answer before, I asked this particular question
   in *.cppbuilder.winapi.

Quote
Michael Liedlgruber wrote:

> Hi Thomas,
> If this other app is using overlay it's not possible (well, at least I
> don't know of any way to do this).

Re:How to make screen copy including video streaming


Thomas Estier schrieb:

Quote
> So now, I just need to make a capture of the main form.
> Know how to do this ?

Well, that's much easier :-)
Use the following snippet to save a form's content to a bitmap file:

void __fastcall TForm::Button1Click(TObject *Sender)
{
    Graphics::TBitmap *tmp=new Graphics::TBitmap();
    tmp->Width=ClientWidth;
    tmp->Height=ClientHeight;

    tmp->Canvas->CopyRect(ClientRect,Canvas,ClientRect);
    tmp->SaveToFile("whatever.bmp");
    delete tmp;

Quote
}

Hope this helps
Michael Liedlgruber

Re:How to make screen copy including video streaming


Hi Michael

I have used the method that you described with a form which contains
a Panel (to display a movie), a Open button (to open a movie),
a Save Frame Button (whose functionality contains your function)  and
a MediaPlayer control.

First I open a movie which is then played on the Panel. I paused
the movie and then I pressed the Save Frame button (which executes your
code).
The saved BMP picture contains the image of the form but the Panel is blank
(actually black) with no image of the video frame.

However, if after opening the movie
1) I minimise the form and
2) I restore the form to the previous size, and
3) I press the Save Frame button,
then the saved BMP file has the image of the video frame on the Panel.
Any idea on how to overcome this problem without minimising and restoring
the
form?

Rodolfo

Quote
"Michael Liedlgruber" <0100110101001...@aon.at> wrote in message

news:3B844217.E919068B@aon.at...
Quote
> Thomas Estier schrieb:

> > So now, I just need to make a capture of the main form.
> > Know how to do this ?

> Well, that's much easier :-)
> Use the following snippet to save a form's content to a bitmap file:

> void __fastcall TForm::Button1Click(TObject *Sender)
> {
>     Graphics::TBitmap *tmp=new Graphics::TBitmap();
>     tmp->Width=ClientWidth;
>     tmp->Height=ClientHeight;

>     tmp->Canvas->CopyRect(ClientRect,Canvas,ClientRect);
>     tmp->SaveToFile("whatever.bmp");
>     delete tmp;
> }

> Hope this helps
> Michael Liedlgruber

Re:How to make screen copy including video streaming


Hi Michael

I have used the method that you described with a form which contains
a Panel (to display a movie), a Open button (to open a movie),
a Save Frame Button (whose functionality contains your function)  and
a MediaPlayer control.

First I open a movie which is then played on the Panel. I paused
the movie and then I pressed the Save Frame button (which executes your
code).
The saved BMP picture contains the image of the form but the Panel is blank
(actually black) with no image of the video frame.

However, if after opening the movie
1) I minimise the form and
2) I restore the form to the previous size, and
3) I press the Save Frame button,
then the saved BMP file has the image of the video frame on the Panel.
Any idea on how to overcome this problem without minimising and restoring
the
form?

Rodolfo

Quote
"Michael Liedlgruber" <0100110101001...@aon.at> wrote in message

news:3B844217.E919068B@aon.at...
Quote
> Thomas Estier schrieb:

> > So now, I just need to make a capture of the main form.
> > Know how to do this ?

> Well, that's much easier :-)
> Use the following snippet to save a form's content to a bitmap file:

> void __fastcall TForm::Button1Click(TObject *Sender)
> {
>     Graphics::TBitmap *tmp=new Graphics::TBitmap();
>     tmp->Width=ClientWidth;
>     tmp->Height=ClientHeight;

>     tmp->Canvas->CopyRect(ClientRect,Canvas,ClientRect);
>     tmp->SaveToFile("whatever.bmp");
>     delete tmp;
> }

> Hope this helps
> Michael Liedlgruber

Re:How to make screen copy including video streaming


Hmm, no clue what's the problem with your app. So I made a small app which
should be very similar to
yours and I just mailed it to you.
Hope it works

Michael Liedlgruber

Rodolfo Frino schrieb:

Quote
> Hi Michael

> I have used the method that you described with a form which contains
> a Panel (to display a movie), a Open button (to open a movie),
> a Save Frame Button (whose functionality contains your function)  and
> a MediaPlayer control.

> First I open a movie which is then played on the Panel. I paused
> the movie and then I pressed the Save Frame button (which executes your
> code).
> The saved BMP picture contains the image of the form but the Panel is blank
> (actually black) with no image of the video frame.

> However, if after opening the movie
> 1) I minimise the form and
> 2) I restore the form to the previous size, and
> 3) I press the Save Frame button,
> then the saved BMP file has the image of the video frame on the Panel.
> Any idea on how to overcome this problem without minimising and restoring
> the
> form?

> Rodolfo

> "Michael Liedlgruber" <0100110101001...@aon.at> wrote in message
> news:3B844217.E919068B@aon.at...
> > Thomas Estier schrieb:

> > > So now, I just need to make a capture of the main form.
> > > Know how to do this ?

> > Well, that's much easier :-)
> > Use the following snippet to save a form's content to a bitmap file:

> > void __fastcall TForm::Button1Click(TObject *Sender)
> > {
> >     Graphics::TBitmap *tmp=new Graphics::TBitmap();
> >     tmp->Width=ClientWidth;
> >     tmp->Height=ClientHeight;

> >     tmp->Canvas->CopyRect(ClientRect,Canvas,ClientRect);
> >     tmp->SaveToFile("whatever.bmp");
> >     delete tmp;
> > }

> > Hope this helps
> > Michael Liedlgruber

Other Threads