Access the Interface of Filters (Delphi 6.0)
Assume you want to access the Emboss filter that was inserted previously as first filter to the play object in the tutorial Programmatically Inserting a Processor Filter.
1. |
Start with the project that you created in Programmatically Inserting a Processor Filter. |
2. |
If you didn’t import LEAD Video Emboss Filter Library before, import it. On the Project pull-down menu, use the Import Type library… . In case you can’t find "LEAD Video Emboss Filter Library" in the list, press the Add button and browse to find and choose the library "LMVEmbs.dll", and press the Open button to close the "Open Type library" dialog box. Select the LEAD Video Emboss Filter Library, and Press install, and then compile and install the package dclusr.dpk. |
3. |
Update the btnSelectFilterClick procedure to be as follows: |
procedure TForm1.btnSelectFilterClick(Sender: TObject);
var
nIndex: Integer;
LMVEmboss: ILMVEmboss;
EmbossAttr:EMBOSS_ATTRIBUTES;
begin
//The string below is retrieved from the Filters List utility
nIndex:= ltmmPlayCtrl1.VideoProcessors.Find('@device:sw:{E526D606-22E7-494C-B81E-AC0A94BFE603}\{E2B7DB17-38C5-11D5-91F6-00104BDB8FF9}');
ltmmPlayCtrl1.SelectedVideoProcessors.Add ( ltmmPlayCtrl1.VideoProcessors.Item (nIndex), 0 );
// Getting the the Emboss object
LMVEmboss:= ILMVEmboss(ltmmPlayCtrl1.GetSubObject ( ltmmPlay_Object_SelVideoProcessor + 0));
// Fill our options
EmbossAttr.bEnabled := 1;
EmbossAttr.lLightAngle := 180;
EmbossAttr.lElevation := 90;
EmbossAttr.lDepth := 50;
// Set our options
LMVEmboss.SetEmbossAttributes ( EmbossAttr );
end;
4. |
Run your program to test it. |