How to make visioforge run - c#

I am having trouble getting a screen capture program to work that I am trying to replicate from a YouTube video. the picture is the error I am getting and my code is supplied. I do not believe my error is in my code I think there is a file I am supposed to run or add somewhere but I can not figure out what I need to do.
IMMAGE OF ERROR WHEN HITTING BUTTON 1 (START BUTTON)
IMMAGE OF THE ERROR WHEN THE PROGRAM IS PUBLISHED
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using VisioForge.Types.OutputFormat;
namespace SCREEN_RECORDER_V2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
videoCapture1.Screen_Capture_Source = new
VisioForge.Types.Sources.ScreenCaptureSourceSettings()
{ FullScreen = true };
videoCapture1.Audio_PlayAudio = videoCapture1.Audio_RecordAudio = false;
videoCapture1.Output_Format = new VFAVIOutput();
videoCapture1.Output_Filename = Environment.GetFolderPath
(Environment.SpecialFolder.MyVideos) + "\\output.avi";
videoCapture1.Mode = VisioForge.Types.VFVideoCaptureMode.ScreenCapture;
videoCapture1.Start();
}
private void button2_Click(object sender, EventArgs e)
{
videoCapture1.Stop();
}
}
}

Based on my test, I reproduced your problem in the picture. After some attempts, I can capture the screen successfully.
First, you could download x64 or x86 exe both by clicking Base package->x64 or x86 in the picture you provided.
Second, please run as administrator to the run the exe.
Third, please install the nuget-package SDK redist base package x86 or x64 and Video Capture SDK redist package x86 or x64.
Finally, after publish the program or directly click the button1 to start the record.

Related

EMGU CV, C#, Visual Studio 2013, sudden "Unable to load DLL 'opencv_core242' on new Capture"

I have a small project I just started. It was working fine. But suddenly I get the following error on the line _capture = new Capture.
{"Unable to load DLL 'opencv_core242': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}
I've read numerous issues similar to this, mostly people installing EMGU CV and trying to get a project going. I have other projects that still work, using the same code, but my current one and new ones I make have this issue.
For some the solution is to add .dll files, like nvcuda.dll or tbb*.dll to the working directory or the Windows32 directory, because opencv_core242.dl can't find them. This doesn't make sense for me though because my other projects are working without any wild additions, and this project was working until it stopped, and now new projects get this error. I find a lot of people with this error when first setting up, but no one inexplicable having it appear in a proven setup.
I've re-referenced the needed libraries in Visual Studio (Emgu.CV, Emgu.CV.UI, Emgu.Util), and I've even gone though the Visual Studio repair process.
What should I be looking at here? I'm getting more confused.
Thanks.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
namespace LaneFollowing_2
{
public partial class Form1 : Form
{
Capture _capture = null;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
_capture = new Capture();
_capture.ImageGrabbed += processImage;
_capture.Start();
}
void processImage(object sender, EventArgs e)
{
// Capture image.
Image<Bgr, Byte> img = _capture.RetrieveBgrFrame().Resize(400, 300, Emgu.CV.CvEnum.INTER.CV_INTER_LINEAR);
imageBox1.Image = img;
//CvInvoke.
}
}
}

'Debug' does not contain a definition for 'Print'

In the following code I would like to just output "hi" into a console window as a test when both of the check boxes are checked.
using System;
using System.Diagnostics;
private void button_Click(object sender, RoutedEventArgs e)
{
show.Text = inputText.Text;
if (check1_cont && check2_cont == true )
{
Debug.Print("hi");
}
}
The only problem is that in System.Diagnostics, the 'Print' in 'Debug.Print' doesn't seem to exist. I've checked https://msdn.microsoft.com/en-us/library/system.diagnostics.debug.print(v=vs.110).aspx and the Print method does exist. Any help regarding a solution to an absent Paint method would be much appreciated.
EDIT 1:
Apparently Debug.WriteLine doesn't give an error, but when I run the program and check the two boxes and press the button, no console appears.
EDIT 2:
In case it helps anyone, here is the full code for the GUI application that I am using.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Diagnostics;
using Microsoft;
using System.Threading.Tasks;
using System.Data;
using System.Dynamic;
using System.Xml;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
namespace normieap
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public Boolean check1_cont = false;
public Boolean check2_cont = false;
public MainPage()
{
this.InitializeComponent();
}
private void button_Click(object sender, RoutedEventArgs e)
{
show.Text = inputText.Text;
if (check1_cont && check2_cont == true )
{
MessageBox.Show("hi");
}
}
private void check1_Click(object sender, RoutedEventArgs e)
{
check1_cont = true;
}
private void check2_Click(object sender, RoutedEventArgs e)
{
check2_cont = true;
}
}
}
The button is going to cause multiple things to go at once, one of the things I would like to go at once is an instance of a console window of some sort to open.
EDIT 3:
This is meant to be a application for PC but for some reason when I started the project, Visual Studio 2015 community thought it was an application for a phone and is causing problems with PC exclusive commands. If someone could give information on how to fix that as well, that would be great.
You appear to not be using the full desktop framework and instead are using some kind of mobile framework. For example, if you check Silverlight's documentation you can see Debug.Print is not available.
If you check the "Version information" for Print you will see
Version Information
.NET Framework
Available since 2.0
Switch to Debug.WriteLine("hi") instead, that should work in all frameworks, its version information says
Version Information
Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
If you are not seeing output I would recommend showing what your test variables are instead.
private void button_Click(object sender, RoutedEventArgs e)
{
show.Text = inputText.Text;
Debug.WriteLine(check1_cont.ToString());
Debug.WriteLine(check2_cont.ToString());
}

Form showing nothing. using CefSharp with Windows form in C#

I am trying to show a webpage in a form using C#. I am using CefSharp to show the webpage (as I would like to test & learn how it works). But since I have worked only on inbuilt webbrowser, I have no idea how to get started with CefSharp(Finding it difficult to get any tutorials). I tried to write this code which executes but the form shows nothing in it. Where am I going wrong ?
Here is my Code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
namespace chrometest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Cef.Initialize(new CefSettings());
var test = new CefSharp.WinForms.ChromiumWebBrowser("http://www.google.com")
{
Dock = DockStyle.Fill,
};
this.Controls.Add(test);
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Edit :
I tried to run the example from https://github.com/cefsharp/CefSharp/tree/cefsharp/41/CefSharp.WinForms.Example
When I try to build the solution, it shows a dialog box saying "Restoring Nuget Package cef.redist.x64 3.2454.1317" with a progresss bar which takes hell lot of time to complete but never completes and after sometime it hangs.
Please help what should I do to get the example running.
The CefSharp project has a few different examples as part of the main project.
Basic Example using Nuget
https://github.com/cefsharp/CefSharp.MinimalExample
More Advanced Examples
https://github.com/cefsharp/CefSharp/tree/cefsharp/41/CefSharp.WinForms.Example
When you installed the project using Nuget it should have opened a Readme.txt file, it contains a lot of useful information.
https://github.com/cefsharp/CefSharp/blob/cefsharp/41/NuGet/Readme.txt
In the context of WinForms there's a few tutorials
http://www.codeguru.com/columns/dotnet/if-you-like-it-put-an-html5-ui-on-it.html
http://thechriskent.com/2014/08/18/embedded-chromium-in-winforms/
For those reading this looking for WPF, there's
http://www.codeproject.com/Articles/881315/Display-HTML-in-WPF-and-CefSharp-Tutorial-Part
http://www.codeproject.com/Articles/887148/Display-HTML-in-WPF-and-CefSharp-Tutorial-Part
More Links
https://github.com/cefsharp/CefSharp.Tutorial
http://thechriskent.com/category/net/cefsharp/

How to find a function of application with ollydbg?

Let's say i released the application below.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello World!","Message Box");
}
}
}
Now here is my questions:
How to find the function of button which is responsible to show
message box after pressing the button with ollydbg?
How to disable the button click ?
Notes:this must be done with ollydbg only. Assume that i don't have access to the code.
A step-by-step example would be greatly appreciated.
Using Olly or IDA is a lot of work for nothing.
Use .NET Reflector for decompilation(there is 14-day trial) and download Reflexil plugin to be able to modify code.
Finding the place should not be too hard since you have decompiled sourcecode.
If you cannot find the place you can try one of these:
Connect reflector to Visual studio
Export source code and just run it from Visual studio
If code is obfuscated I cannot help you there, you just must start playing with it till you defeat obfuscation
With Reflexil addon you can simply delete/modify the function
Why not use IDA? You can "easily" nop out the function.

c# simple skype app throws COM exception

I am making my first Skype app that can simply message a user but when I debug I get a exception that crashes my app.
Here is the code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using skype_app;
using SKYPE4COMLib;
namespace skype_app
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
var oskype = new SKYPE4COMLib.Skype();
oskype.PlaceCall(textBox1.Text);
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
var oskype = new SKYPE4COMLib.Skype();
oskype.SendMessage(textBox1.Text, textBox2.Text);
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
}
}
i have use some extra references
references list:
Microsoft.Csharp
SKYPE4COMlib
SkypeDialoglib
system
system.core
system.data
system.data.DataSetEXTensions
system.deployment
system drawing
System.Windows.forms
System.xml.linq
Here is the exception i get:
System.RUntime.InteropServices.ComException : {"connection refused"}
So I guess my main question is why does my connection get refused when Skype dose not even open the dialogue asking if I want to allow the connection ?
The issue is that you're trying to debug in Visual Studio. Unfortunately, according to Skype themselves, they do not support using this API & debugging in VS:
Per the link:
The most comment cause for this is you are trying to debug the program
in Visual Studio. Going forward we will not be able to support using
the visual studio hosting process for debugging. You can turn it off
by:
Open your project in VS
Open your projects properies
click the debug tab
untick "use visual studio hosting process"
rebuild your application and begin debugging and it should work ok.
i face the same issue. this way i solved it.
here is my code
Skype skype;
skype = new SKYPE4COMLib.Skype();
Call call = skype.PlaceCall(txtPhonenNo.Text);
first thing login to skype and go to Tools > option > advanced settings
your screen would look like
click on manage other program's access to skype
then another window will come which will show all program name which try to access skype. if any exist just select all and remove it.
then run your program again and go to that screen where this option was available called click on manage other program's access to skype
click there and a windows will come which will display the name of your apps just select that name and click on change button then another window will come which looks like
in that window just select the option called allow this program to access skype then a dialog come on the skype window which looks like
where you need to click on allow access button and then your job will be done. hope this will help.

Categories

Resources