Skip to content

Instantly share code, notes, and snippets.

@Microncode
Microncode / CSWebCam-Snap-Example.cs
Last active February 25, 2020 09:27
Here is a snap example of using the CSWebCam in order save the camera activity to video file using C#:
//Set the video format
_Camera.VideoResolutionX = txtVideoResolutionX.Text;
_Camera.VideoResolutionY = txtVideoResolutionY.Text;
//Set the FPS
_Camera.VideoFPS = "30";
//Set the buffer size
_Camera.BufferSize = "100MB";
@Microncode
Microncode / CSVideoPlayer-Snap-Example.cs
Created February 25, 2020 08:47
Here is a snap example of using the CSVideoConverter in order to play ANY video (and audio) files using C#:
//Init function, must be call before using any functionality of the library.
videoPlayer.Init(@"../../../libs/ffmpeg/x86/bin", "UserName", "RegKey");
videoPlayer.Open(new Uri(_mediafile));
videoPlayer.Play();
@Microncode
Microncode / CSVideoConverter-Snap-Example.cs
Last active March 1, 2020 15:12
Here is a snap example of using the CSVideoConverter using C#:
//Create a new instance of the library with the path of the ffmpeg libraries:
_CSVideoConverter = new CSVideoConverter.VideoConverter(@"../../../libs/ffmpeg/x86/bin",
"UserName", "RegKey");
//Set the source file
_CSVideoConverter.FileSource = txtSource.Text;
//Set the destination file
_CSVideoConverter.FileDestination = txtDestination.Text;
@Microncode
Microncode / CSScreenRecorder-Snap-Example.cs
Created February 25, 2020 07:21
Here is a snap example of using the CSScreenRecorder using C#:
//In order to get your own UserName and RegKey please order a license.
using (ScreenRecorder = new CSScreenRecorder.ScreenRecorder("UserName", "RegKey"))
{
//Set the area to record
ScreenRecorder.RecordScreenHeight = Int32.Parse(txtHeight.Text);
ScreenRecorder.RecordScreenWidth = Int32.Parse(txtWidth.Text);
ScreenRecorder.RecordScreenTop = Int32.Parse(txtTop.Text);
ScreenRecorder.RecordScreenLeft = Int32.Parse(txtLeft.Text);
//Track mouse move
@Microncode
Microncode / CSPhantomJS-Snap-Example.cs
Last active March 1, 2020 15:15
Here is a snap example of using the CSPhantomJS using C#:
//Create a new instance of the library with the path of
//the phantomjs libraries:
_WebpageCapture = new CSPhantomJS(@"../../../libs/phantomjs/bin", "UserName", "RegKey");
_WebpageCapture.DestinationFormat = DestinationFormat.Image;
_WebpageCapture.ImageFormat = "1920px";
_WebpageCapture.URL = "https://www.microncode.com";
_WebpageCapture.OutFile = _FileName;
//You can add an additional arguments:
@Microncode
Microncode / CSFFmpeg-Snap-Example.cs
Created February 25, 2020 05:17
Here is a snap example of using the CSFFmpeg using C#:
//Create a new instance of the library with the direction of the ffmpeg libraries
_CSFFmpeg = new CSFFmpeg.CSFFmpeg(@"../../../libs/ffmpeg/x86/bin", "UserName", "RegKey");
//Set the arguments
_CSFFmpeg.ArgsDirect = txtArguments.Text;
//Events
//On ffmpeg output event
@Microncode
Microncode / CSID3Tags-Snap-Example.cs
Last active January 20, 2020 19:00
Here is a snap example of using the CSID3Tags in order to set the ID3 tags of the media file using C#
//A snap example of using the CSID3Tags in order to set the
//ID3 tags of the media file using C#
//Open the media file:
iD3Tags1.Open(txtMediaFile.Text);
//Set the title:
iD3Tags1.TagTitle = txtTagTitle.Text;
//Set the album name:
@Microncode
Microncode / CSFreeDB-Snap-Example.cs
Last active February 25, 2020 23:05
Here is a snap example of using the CSFreeDB in order to get the information about ab Audio CD using C# in async mode:
//Init the component
freeDB1.UserName = "Your email";
freeDB1.UserKey = "Your registration key";
// Tracks names:
foreach (string trckFreeDB in freeDB1.GetFreeDBInfoAsync(cboDevice.SelectedIndex).FreeDBTracksInfo)
{
lstTracks.Items[cntr].SubItems[1].Text = trckFreeDB.ToString();
cntr = cntr + 1;
}
@Microncode
Microncode / CSDVDCDBurner-Snap-Example.cs
Last active February 1, 2020 13:43
Here is a snap example of using the CSDVDCDBurner in order to burn a file and a directory to DVD media using C#
//Init the component
dvdcdBurner1.UserName = "Your email";
dvdcdBurner1.UserKey = "Your registration key";
//Add a file to the burnning list
dvdcdBurner1.AddFile(OpenFileDialog1.FileName);
//Add a directory to the burnning list
//This will add all the files and sub directories
dvdcdBurner1.AddDir(sDirName);
@Microncode
Microncode / CSAudioVisualization-Snap-Example.cs
Created January 19, 2020 22:01
Here is a snap example of using the CSAudioConverter in order to Display audio visualization using C#
//Set the mode
audioVisualization1.Mode = CSAudioVisualization.Mode.WasapiLoopbackCapture;
//Set the device index
audioVisualization1.DeviceIndex = cboAudioSource.SelectedIndex;
//Set the quality
audioVisualization1.HighQuality = true;
//Set the interval