Shows the specified property dialog for the caching filter.
public void ShowCacheDialog(
Leadtools.Multimedia.TargetFormatDlg Dialog,
IWin32Window hWnd
)
Public Sub ShowCacheDialog( _
ByVal Dialog As Leadtools.Multimedia.TargetFormatDlg, _
ByVal hWnd As IWin32Window _
)
public:
void ShowCacheDialog(
Leadtools.Multimedia.TargetFormatDlg Dialog,
IWin32Window^ hWnd
)
Dialog
Value that specifies which dialog to display. Must be one of the TargetFormatDlg enumeration values.
hWnd
Value that specifies the dialog owner's window handle.
Use the TargetFormat.UseFilterCache property to get a value that indicates whether the toolkit is currently caching filters; or set a value that indicates whether to enable or disable the caching of filters. Use the TargetFormat.GetCacheObject method to retrieve the caching filter object. Use the TargetFormat.HasCacheDialog method to query whether the specified property dialog for the caching filter is available.
using Leadtools;
using Leadtools.Multimedia;
using LeadtoolsMultimediaExamples.Fixtures;
public bool _result = false;
public CaptureCtrlForm _form = new CaptureCtrlForm();
public void HasCacheDialogExample()
{
// reference the capture control
CaptureCtrl capturectrl = _form.CaptureCtrl;
try
{
// set a video device first. use your video device's name here
if (capturectrl.VideoDevices["Analog"] == null)
throw new Exception("No Analog audio device available");
capturectrl.VideoDevices["Analog"].Selected = true;
// set the video compressor
capturectrl.VideoCompressors.Mpeg2.Selected = true;
// reference the target formats collection
TargetFormat fmt = capturectrl.TargetFormats.MPEG2Program;
// enumerate through the list of formats
foreach (TargetFormat af in capturectrl.TargetFormats)
{
// check the formats valid compressor and stream type
bool isValid = (af.IsValidCompressor(capturectrl.VideoCompressors.Mpeg2.Name) == TargetFormatCompressor.Valid);
StreamFormatType types = af.Streams;
// if valid, select it
if (isValid && ((types & StreamFormatType.Video) == StreamFormatType.Video))
{
fmt = af;
fmt.Selected = true;
break;
}
}
// check to see if the current target format has a cache dialog
if (fmt != null && fmt.HasCacheDialog(TargetFormatDlg.VideoCompressor))
{
// show the dialog
fmt.ShowCacheDialog(TargetFormatDlg.VideoCompressor, _form);
// set the result
_result = true;
}
}
catch (Exception)
{
_result = false;
}
}
Imports Leadtools
Imports Leadtools.Multimedia
Imports LeadtoolsMultimediaExamples.Fixtures
Public _result As Boolean = False
Public _form As CaptureCtrlForm = New CaptureCtrlForm()
Public Sub HasCacheDialogExample()
' reference the capture control
Dim capturectrl As CaptureCtrl = _form.CaptureCtrl
Try
' set a video device first, you should use your video device name here
If capturectrl.VideoDevices("Analog") Is Nothing Then
Throw New Exception("No Analog audio device available")
End If
capturectrl.VideoDevices("Analog").Selected = True
' set the video compressor
capturectrl.VideoCompressors.Mpeg2.Selected = True
' reference the target formats collection
Dim fmt As TargetFormat = capturectrl.TargetFormats.MPEG2Program
' enumerate through the list of formats
For Each af As TargetFormat In capturectrl.TargetFormats
' check the formats valid compressor and stream type
Dim isValid As Boolean = (af.IsValidCompressor(capturectrl.VideoCompressors.Mpeg2.Name) = TargetFormatCompressor.Valid)
Dim types As StreamFormatType = af.Streams
' if valid, select it
If isValid AndAlso ((types And StreamFormatType.Video) = StreamFormatType.Video) Then
fmt = af
fmt.Selected = True
Exit For
End If
Next af
' check to see if the current target format has a cache dialog
If Not fmt Is Nothing AndAlso fmt.HasCacheDialog(TargetFormatDlg.VideoCompressor) Then
' show the dialog
fmt.ShowCacheDialog(TargetFormatDlg.VideoCompressor, _form)
' set the result
_result = True
End If
Catch e1 As Exception
_result = False
End Try
End Sub
Products |
Support |
Feedback: ShowCacheDialog Method - Leadtools.Multimedia |
Introduction |
Help Version 19.0.2017.6.16
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.