ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Screencapture in Media Foundation
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

john_siggy@yahoo.com

USA
158 Posts

Posted - Jan 21 2017 :  16:00:03  Show Profile  Reply
Hey Nigel,

Is there anyway to get screen capture in the Media Foundation?

xequte

38613 Posts

Posted - Jan 22 2017 :  04:04:31  Show Profile  Reply
Hi

MediaFoundationNotify is called for each frame, so you can just assign/save the bitmap then:

// frame received
procedure Tfmain.ImageEnView1MediaFoundationNotify(Sender, MediaFoundationObject: TObject; NotifyType: TIEMediaFountationNotifyType);
var
  sample: TIEMFReceivedSample;
begin
  sample := ImageEnView1.IO.MediaFoundationSourceReader.GetNextSample();
  try
    if sample.StreamType = mmf_VIDEO_STREAM then
    begin
      sample.DecodeSample(ImageEnView1.IEBitmap);

      --> Do something with ImageEnView1.IEBitmap...

      ImageEnView1.Update();
    end;
  finally
    sample.Free();
  end;

  inc(FPS);
end;


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: