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
 Digital zoom with DirectShow?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

whisper1980

USA
83 Posts

Posted - Apr 17 2021 :  18:33:39  Show Profile  Reply
I can do digital zoom with the Media Foundation methods via:
ImageEnView1.IO.MediaFoundationSourceReader.VideoProcessor.SetSourceRectangle(vRect);

But I can't seem to find a way to do it with DirectShow. Any hints you can provide? I tried using the following, but didn't seem to do anything, even forcing RenderVideo to true (it was false after a fDirectShow.Connect or fDirectShow.Run yet was showing the video stream using EnableSampleGrabber):
fDirectShow.SetVideoRenderRect(vSrcRect, vDstRect);

Thanks,

Eric

xequte

38107 Posts

Posted - Apr 19 2021 :  17:42:55  Show Profile  Reply
Hi Eric

SetVideoRenderRect is called internally by ImageEnView each time is painted, so you cannot use it directly. It is used to output the video at the size of the TImageEnView bitmap. So you should use the zoom and positioning properties of TImageEnView to adjust the video rect.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

whisper1980

USA
83 Posts

Posted - Apr 19 2021 :  20:01:40  Show Profile  Reply
Thanks, this seems to do the trick...

fDirectShow.GetSample(ImageEnView1.IEBitmap);
ImageEnView1.Proc.Crop(0,0, 200,200);
ImageEnView1.Update;

But of course, instead of 0,0 200,200, I update the x, y positions based on my digital zoom values like I did with my MediaFoundation version.


Eric
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: