Click here to Skip to main content
15,903,385 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Freinds,

I want to save Image to particular path from Image Control. Sample coding are below.

XMLA Code
----------
<Image Source="{Binding signat}" Canvas.Left="6" Canvas.Top="74" Height="423"                x:Name="img_signature" Stretch="Fill" Width="573">
</Image>

Cs code
-------
Binding b = new Binding();
b.Source = ds.Tables["tab_grdbindload"];
b.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
b.Path = new PropertyPath("signat");
this.img_signature.SetBinding(Image.SourceProperty, b);

The above coding used to loaded image from database.
Now I want to save loaded image in particular path.

Thanks in advance,
Maha S.
Posted

1 solution

my solution is here its working fine..

var encoder = new PngBitmapEncoder();                 encoder.Frames.Add(BitmapFrame.Create((BitmapSource)img_signature.Source));
using (FileStream stream = new FileStream(strpath + strfilename, FileMode.Create))
encoder.Save(stream);
 
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