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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Screencapture in Media Foundation

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
john_siggy@yahoo.com Posted - Jan 21 2017 : 16:00:03
Hey Nigel,

Is there anyway to get screen capture in the Media Foundation?
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jan 22 2017 : 04:04:31
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