libvlc_video_take_snapshot() in C#
Posted: 27 Dec 2010 22:52
Hello,
im having trouble taking snapshots , im using VLC1.1.4 in a winform C# app. Everyting works great except for libvlc_video_take_snapshot. when i ask for a snapshot nothring happenes :
code:
so when i click to take a snapshot ..
nothing happenes,no crahsed , and no lagging ( as some people experienced with 9.8.0 and other DLLs) . when i researched the subject , i found out that some people got the file to be generated without images ( in C++) and others had exceptions and crahses ( also in C++) but i have not found anyone who got this feature to work in C#. The function looks simple but doesnt work for me . Does it have to do with the arg string ? do i ned to enable the snapshot feature ?
my args are:
Thank you
im having trouble taking snapshots , im using VLC1.1.4 in a winform C# app. Everyting works great except for libvlc_video_take_snapshot. when i ask for a snapshot nothring happenes :
code:
Code: Select all
[DllImport("libvlc")]
internal static extern void libvlc_video_take_snapshot(IntPtr p_media_player, [MarshalAs(UnmanagedType.LPStr)] string psz_filepath, uint i_width, uint i_height);
Code: Select all
public void TakeSnapShot(String file, int width, int height)
{
uint width_1 = (uint)width;
uint height_1 = (uint)height;
LibVlc.libvlc_video_take_snapshot(Handle, file, width_1, height_1);
}
public int Height
{
get
{
int rtn = LibVlc.libvlc_video_get_height(Handle);
return rtn;
}
}
public int Width
{
get
{
int rtn = LibVlc.libvlc_video_get_width(Handle);
return rtn;
}
}
so when i click to take a snapshot ..
Code: Select all
private void toolStripButton4_Click(object sender, EventArgs e)
{
TakeSnapShot("photo.png",Width,Height);
//also tried "C:\\snapshotFolders\\photo.png"
// tried having Width and Height set to equal "0" as a default
}
my args are:
Code: Select all
args = new string[] {
"-I", "dummy", "--ignore-config",
@"--plugin-path=C:\Users\bin\Debug\plugins"};