Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,
I have a program that displays the images taken from the webcam as described in this article at http://irslab.blogspot.com/2010/07/webcam-using-aforgenet-part-i.html?showComment=1309837336161#comment-c7001370807997667575[^]. It uses AForge library to capture the image and since it is a Windows Form application it can simply display the image by using the following code

C#
void camera_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bmp = (Bitmap)eventArgs.Frame.Clone();
            //simply set the bmp as the Image in pictureBox1
            pictureBox1.Image = bmp;
        }


BUT, when it comes to Expression blend, you can't do this to the Image placeholder you find there. You can only give the url of an image as follows

imagePlaceHolder.Source =             (ImageSource(newImageSourceConverter().ConvertFromString(fileName));


How can I direct the imagePlaceHolder to my Bitmap image???

Somebody please help.....!!!!

Thanks in advance.
Posted

You can only give the url of an image as follows
Not true you can give a url, and you can provide an ImageSource. For how to convert your Bitmap to a BitmapSource see Bitmap to BitmapSource[^]
 
Share this answer
 
Comments
Espen Harlinn 2-Oct-11 7:35am    
5'ed!
Simon Bang Terkildsen 2-Oct-11 8:01am    
Thank you, Espen
Well thanks a lot for attending to solve my issue but it is not what I really wanted. But recently I found the real solution. You can simply use the PictureBox control you have in Windows.Forms.Controls in the WPF application.
It is simple as that. To know how to do that just read the Code Project article
[
Host Windows Form Controls in WPF
]

Thanks all.
 
Share this answer
 

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