Hello,
I implemented exposure adjustment to frame via TRVCamera.OnPaint successfully. Then I tried the same for TRVCamMultiview.OnViewerPaint but I started to get Scanline errors (I use Scanline for getting pixels) and frame is drawn outside main camera area. I use Viewer.FrameRect but it seems it is wrong. Correct Frame is ensured by checking ViewerIndex.
RVMedia 9.2, VCL, FFMPEG, Delphi 11.2, 64bit
TRVCamMultiview.OnViewerPaint problems
-
- Site Admin
- Posts: 17520
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: TRVCamMultiview.OnViewerPaint problems
Please send me a test project (as simple as possible)
Re: TRVCamMultiview.OnViewerPaint problems
Here's example crated by combination of your demos.
- Attachments
-
- CamListMulti.zip
- (4.63 KiB) Downloaded 2434 times
-
- Site Admin
- Posts: 17520
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: TRVCamMultiview.OnViewerPaint problems
I cannot see scanline error.
You cannot use FrameRect.
You can get the video client area as RVCamMultiView1.Viewers[ViewerIndex].GetViewerRects, but there is no method that allow to get video rectangle inside this area. I'll add this method in the next update (GetVideoRect).
Also, in full screen mode, a copy of this MultiView is created that is not accessible. I'll add property FullScreenMultiView.
The code will be:
RVConvertFrom96DPI is declared in MRVCore.pas
You cannot use FrameRect.
You can get the video client area as RVCamMultiView1.Viewers[ViewerIndex].GetViewerRects, but there is no method that allow to get video rectangle inside this area. I'll add this method in the next update (GetVideoRect).
Also, in full screen mode, a copy of this MultiView is created that is not accessible. I'll add property FullScreenMultiView.
The code will be:
Code: Select all
procedure TfrmMain.RVCamMultiView1ViewerPaint(Sender: TObject; Viewer: TRVCamView; ViewerIndex: Integer; VideoFrame: TBitmap; ACanvas: TCanvas; var CanDrawFrame: Boolean);
var
VideoRect, AudioRect: TRect;
begin
if (ViewerIndex<>4) or (VideoFrame.Width=0) then
Exit;
FVideoFrame.Assign(VideoFrame);
CanDrawFrame:=False;
GBlur(FVideoFrame,3);
if RVCamMultiView1.FullScreenMultiView <> nil then
RVCamMultiView1.FullScreenMultiView.Viewers[ViewerIndex].GetViewerRects(VideoRect, AudioRect)
else
RVCamMultiView1.Viewers[ViewerIndex].GetViewerRects(VideoRect, AudioRect);
inc(VideoRect.Top, RVConvertFrom96DPI(Viewer.CaptionHeight, Self));
VideoRect := Viewer.GetVideoRect(VideoRect, FVideoFrame.Width, FVideoFrame.Height);
ACanvas.StretchDraw(VideoRect, FVideoFrame.GetBitmap);
end;
-
- Site Admin
- Posts: 17520
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: TRVCamMultiview.OnViewerPaint problems
Added in RVMedia 9.3 (just uploaded)