Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
i am refering the link DirectX.Capture Class Library[^]
for video capture and on preview button click i write
capture.PreviewWindow = image1.Source;
where the error is
Cannot implicitly convert type 'System.Windows.Media.ImageSource' to 'System.Windows.Forms.Control'...

i also refer
problem with capturing video from webcam in WPF[^]
this link but i am not getting what i have to do..
what is solution in wpf...
my code is..
<pre lang="cs">try
           {
               if (capture.PreviewWindow == null)
               {
                   capture.PreviewWindow = mediaElement1;
                   //mnuPreview.Checked = true;
               }
               else
               {
                   capture.PreviewWindow = null;
                   // mnuPreview.Checked = false;
               }
           }
           catch (Exception ex)
           {
               System.Windows.MessageBox.Show("Unable to enable/disable preview. Please submit a bug report.\n\n" + ex.Message + "\n\n" + ex.ToString());
           }


Posted
Updated 6-May-11 2:26am
v3

1 solution

 
Share this answer
 
Comments
vishal_h 6-May-11 8:28am    
thanks sir but i have updated my question i am not getting what should i write at this capture.PreviewWindow = mediaElement1;
statement becouse capture.PreviewWindow is form control..what modification i hv to do...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900