Hi,
I have a problem when using MediaFoundationSourceReader to capture images from Surface Pro cameras:
- when holding the tablet on landscape mode, everything is fine. But when I rotate the tablet to portrait orientation, the captured image itself is again fine, but the total captured image has left and right black borders. How can I avoid them so that it acts as the Microsoft camera app?
- Also when using the Rear Camera of Surface and rotate tablet to portrait, the output is rotated by 180 degrees. How to avoid this?
Here is the used code for Delphi XE and ImageEN 6.3.2:
with imgPreview.IO.MediaFoundationSourceReader do
begin
if VideoInputs.Count > 0 then
begin
SetSelectedStreams(mmf_VIDEO_STREAM, true);
SelectMediaType(mmf_VIDEO_STREAM, cbModes.ItemIndex);
// auto-rotation (win8 only!)
if goIsWindows8OrHigher then
begin
VideoProcessor.SetMirror(mfpmNone);
VideoProcessor.SetRotation(mfprNormal);
end;
// ...
// start capturing
StartCapturing;
// ....
end;
end;