I am working on a window phone application where I am capturing image
from the primary camera and want to generate the image name based on different parameter like date ,time
etc. For that I am defining a method:
private string fnGenerate()
{
string fileName = "";
// Logic to be put later.
fileName = "testImage5.jpg";
return fileName;
}
image will come from this:
public void fnSaveImage(Stream imgStream, out string imageName)
{
imageName = fnGenerateFileName();
BitmapImage appCapImg = new BitmapImage();
appCapImg.SetSource(imgStream);
IsolatedStorageFile appImgStore = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream appNewStream = appImgStore.CreateFile(imageName);
WriteableBitmap appWrtBmp = new WriteableBitmap(appCapImg);
appWrtBmp.SaveJpeg(appNewStream, appWrtBmp.PixelWidth, appWrtBmp.PixelHeight, 0, 10);
appNewStream.Close();
}
But as of now I have hard coded the image name, but I want to generate the image name on the above parameter. Can any one help how to generate the name for image