Author |
Topic  |
|
whisper1980
 
USA
83 Posts |
Posted - Apr 17 2021 : 18:33:39
|
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
    
38796 Posts |
Posted - Apr 19 2021 : 17:42:55
|
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
|
 |
|
whisper1980
 
USA
83 Posts |
Posted - Apr 19 2021 : 20:01:40
|
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 |
 |
|
|
Topic  |
|
|
|