How to integrate MCA camera with WPF?

How to integrate MCA camera with WPF?

Hi, Steven:

Our MCA application uses WPF (Windows Presentation Foundation) as GUI component. As you know, WPF could not control HANDLE type directly. So, I add MCA camera HANDLE into WindowsFrom type, and then add WindowsFrom object into WPF. But, WPF component could not show camera preview successfully. Could you give me some suggestion for my WPF GUI component to control MCA C5 camera for capaturing photo?

Looking forward to your ideas, which is very help for my project. Thanks for your help.

B. R.
Kevin

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Kevin,

Unfortunately, XAML and WPF were not a consideration when we created the MCA SDK. From what we have seen, there isnt an easy way to get a handle for XAML/WPF. If you cannot get a handle for the window then there is not much you can do with the MCA SDK since the window handle is a required parameter.

We are looking at how we can support this in future versions of the MCA SDK, but no confirmed plans yet.

-Steve

Hi Kevin,

Firstly , You have to define a Forms.Panel to handle;

System.Windows.Forms.Panel wfPanel = new System.Windows.Forms.Panel();

Then you can use this panel in your WPF application like that;

private WindowsFormsHost GetHost()

{

WindowsFormsHost host = new WindowsFormsHost();

return host;

}

public wMCACamera()

{

this.InitializeComponent();

//How do I host a Windows Forms control in a WPF application?

WindowsFormsHost host = GetHost();

host.Child = wfPanel;

this.gridPreview.Children.Add(host);

}

And I am trying this procedure for RFID&Barcode ButtonClick. But I have not succeeded yet. But, you can handle a panel to show camera preview like above procedure,

What's more, follow that link;

http://windowsclient.net/learn/integration.aspx

I think I will solve MCA-WPF handle problem with that article. But i need to examine more. I will inform you about his situation.

Unsal Donmez

Leave a Comment

Please sign in to add a comment. Not a member? Join today