I want to allow people to put an image in an ImageEdit control for a specific View, and when they save changes to the view, it saves the image in a specific folder and with a new filename and path, so that we can access it in a report for an image later. I am storing the path in a database. I am not sure how to go about this though.
Using ImageEdit to save an Image with a specific path to a different folder
Answers approved by DevExpress Support
Hello,
Please accept my apologies for the delayed response.
ImageEdit allows users to load and save images without coding. You can click this editor to invoke FileDialog to select an image from a disk. Or, invoke a toolbar by moving the mouse cursor over this editor and click the Open button. Please see the ImageEdit help topic where this toolbar is demonstrated.
You can save the image to another place using the same toolbar. From what I gather, you want to do it in code so that all images are stored in a specific folder. For this, write the Source's stream to a FileStream and save it to the specific directory:
C#BitmapImage img = (BitmapImage)imageEdit.Source;
MemoryStream str = (MemoryStream)img.StreamSource;
FileStream fs = new FileStream(fileName, FileMode.OpenOrCreate);
str.WriteTo(fs);
fs.Close();
Please consider this approach and let me know whether it satisfies your requirements.
I look forward to your reply.