Hello
I am recording a web camera with text information using the OnGetImage event
When I used RVMediaVCLSetupVer8.exe, it was recorded well
But when I try to record using RVMediaVCLSetup_v11.exe
The web screen is overlapping with text on the screen when Camera On
What is wrong? Please advise
Thank you!
Adding text to video
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Adding text to video
What's your code for writing text?
Most probably, it should be protected by a critical section.
Most probably, it should be protected by a critical section.
Re: Adding text to video
Code: Select all
procedure TfrmMain.RVCamera1GetImage(Sender: TObject; img: TRVMBitmap);
var
bmp: TBitmap;
sDisplayStemp : Array[0..20] of String;
iSZ: TSize;
rDT, rTS : Real;
iTH, iTM, iDY : Integer;
i, iBtCnt : Integer;
sTS : String;
begin
rDT := Now;
iDY := Trunc(rDT);
rDT := rDT - iDY;
iTH := Trunc(rDT * 24);
iTM := Trunc(rDT * 24 * 60) - (iTH * 60);
rTS := (rDT * 24 * 60 * 60) - (iTH * 60 * 60) - (iTM * 60);
if rTS > 10 then sTS := Format('%2.1f', [rTS])
else sTS := '0' + Format('%2.1f', [rTS]);
bmp := img.GetBitmap;
with bmp.Canvas do
begin
Lock;
try
if CFG.bBkView then
begin
Brush.Style := bsSolid;
Brush.Color := CFG.iBkCR;
Rectangle(cfg.iSX, cfg.iSY, CFG.iEX, CFG.iEY);
end;
Brush.Style := bsClear;
Font.PixelsPerInch := 96;
iBtCnt := 0;
IND.sVal[0] := FormatDateTime('yyyy.mm.dd.', now);
IND.sVal[1] := Format('%2d:%.2d:', [iTH, iTM]) + sTS;
IND.sVal[2] := Format('%8.2f', [IND.rTM]);
for i := 0 to 20 do
begin
if CFG.bView[i] then
begin
Font.Name := CFG.sFtNm[i];// 'Tahoma';
Font.Color := CFG.iFtCR[i]; // clWhite;
Font.Size := CFG.iFtSZ[i]; // 32
if not CFG.bStyle[i, 0] and not CFG.bStyle[i, 1] then Font.Style := [];
if not CFG.bStyle[i, 0] and CFG.bStyle[i, 1] then Font.Style := [fsItalic];
if CFG.bStyle[i, 0] and not CFG.bStyle[i, 1] then Font.Style := [fsBold];
if CFG.bStyle[i, 0] and CFG.bStyle[i, 1] then Font.Style := [fsBold,fsItalic];
sDisplayStemp[i] := CFG.sTitle[i] + IND.sVal[i] + ' ' + CFG.sUnit[i];
TextOut(CFG.iX[i], CFG.iY[i], sDisplayStemp[i]);
end;
end;
finally
Unlock;
end;
end;
img.UpdateData;
end;
Re: Adding text to video
Written in Delphi 7.0 (Build8.1)
-
- Site Admin
- Posts: 17602
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Adding text to video
I confirm the problem.
Quick fix:
Open MRVWinWebCamera.pas.
Find the line:
bmp.Modified := TRUE;
Add after:
bmp.ModifiedData := TRUE;
A critical section is not needed.
Quick fix:
Open MRVWinWebCamera.pas.
Find the line:
bmp.Modified := TRUE;
Add after:
bmp.ModifiedData := TRUE;
A critical section is not needed.
Re: Adding text to video
Resolved
bmp.ModifiedData := TRUE;
Added and confirmed no issues
Thank you
bmp.ModifiedData := TRUE;
Added and confirmed no issues
Thank you