Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys, I'm new to wpf. I need help with this. I'm using WPF Browser Application to do this project.

I have an image in the Image control...

C#
<Grid>
       
        <Image  Height="164" HorizontalAlignment="Left" Margin="24,67,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="255" Source="/CaptureImage;component/Images/Penguins.jpg"  />
        <Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="72,264,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
    </Grid>



I have a file on my desktop page. The name of the file is "My WPF Images". My problem is, how do I capture this image and save it to my file? Help needed!! Thank you very much!!
Posted
Comments
Prasad Khandekar 19-May-14 3:36am    
Hello Alif,

Please have a look at this discussion thread (http://stackoverflow.com/questions/4391109/how-do-i-load-html-into-webbrowser-control-for-wpf)

Regards,
Alif Marz 30-May-14 3:03am    
hmmm. ok thx. Another question, using the same image box mentioned above, how do I change it to a jpg format picture? Is there a code to do it and same time save it?
Prasad Khandekar 5-Jun-14 5:11am    
If you are referring to the code found in the above mentioned thread, then converting the image to a jpg is very simple. use save method of the Image class (http://msdn.microsoft.com/en-us/library/9t4syfhh.aspx) to convert the image to desired format.

Regards,
Alif Marz 9-Jun-14 2:04am    
hey Prasad,

This website (http://msdn.microsoft.com/en-us/library/9t4syfhh.aspx)it says that it uses Window Forms. does it work on WPF Browser Application?? Because from what I know, Windows Forms and WPF are totally different.
Prasad Khandekar 9-Jun-14 2:08am    
Hello Alif,

Image class is in System.Drawing namespace. You should be able to use it without any problems.

Regards,

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