Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, September 28, 2021 10:38:58 AM(UTC)

Amin  
Amin

Groups: Manager, Tech Support
Posts: 367

Was thanked: 1 time(s) in 1 post(s)

The following C# code shows how to use the LEADTOOLS PlayCtrl to capture a still image from a video file stored in a byte array.

Code:
System.IO.MemoryStream stream = new System.IO.MemoryStream(videoByteArray);
stream.Position = 0;
playCtrl.SourceStream = stream;
playCtrl.Run();
playCtrl.Pause();
playCtrl.CurrentPosition = playCtrl.Duration / 4;
Image image = playCtrl.GetStillImage(1000);
image.Save(OutputImageFile, System.Drawing.Imaging.ImageFormat.Jpeg);


The code pauses the video at the quarter duration mark and takes the snapshot from there. If a different snapshot point is desired, set the time in seconds using the playCtrl.CurrentPosition property before calling GetStillImage().
Amin Dodin

Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.028 seconds.