ChrisMDrew
asked on
Windows Mobile 7.1 displaying camera photos
Hi,
I have used the Windows Mobile 7.1 new camera functions to successfully take and store pictures as defined in the MSDN examples.
string fileName = _displayedJob.Worknumber + "_" + savedCounter.ToString() + ".jpg";
library.SavePictureToCamer aRoll(file Name, e.ImageStream);
I also save the image to Isolated Strorage again using the MSDN example code - the vital bit seems to be :-
using (IsolatedStorageFile isStore = IsolatedStorageFile.GetUse rStoreForA pplication ())
{
using (IsolatedStorageFileStream targetStream = isStore.OpenFile(fileName, FileMode.Create, FileAccess.Write))
{
// Initialize the buffer for 4KB disk pages.
byte[] readBuffer = new byte[4096];
int bytesRead = -1;
// Copy the image to isolated storage.
while ((bytesRead = e.ImageStream.Read(readBuf fer, 0, readBuffer.Length)) > 0)
{
targetStream.Write(readBuf fer, 0, bytesRead);
}
}
}
I then store the filename used above. Later I have a listbox picture viewer - the idea is to show thumbnails of all pictures taken using the filename to identify the pictures. For testing I am using :-
ImageSource testImageSource = new BitmapImage(new Uri(_displayedJob.Pictures [0], UriKind.Relative));
lblPicture1.Text = _displayedJob.Pictures[0];
imgTest.Source = testImageSource;
But I don't see an image at all - what am I missing?
I have used the Windows Mobile 7.1 new camera functions to successfully take and store pictures as defined in the MSDN examples.
string fileName = _displayedJob.Worknumber + "_" + savedCounter.ToString() + ".jpg";
library.SavePictureToCamer
I also save the image to Isolated Strorage again using the MSDN example code - the vital bit seems to be :-
using (IsolatedStorageFile isStore = IsolatedStorageFile.GetUse
{
using (IsolatedStorageFileStream
{
// Initialize the buffer for 4KB disk pages.
byte[] readBuffer = new byte[4096];
int bytesRead = -1;
// Copy the image to isolated storage.
while ((bytesRead = e.ImageStream.Read(readBuf
{
targetStream.Write(readBuf
}
}
}
I then store the filename used above. Later I have a listbox picture viewer - the idea is to show thumbnails of all pictures taken using the filename to identify the pictures. For testing I am using :-
ImageSource testImageSource = new BitmapImage(new Uri(_displayedJob.Pictures
lblPicture1.Text = _displayedJob.Pictures[0];
imgTest.Source = testImageSource;
But I don't see an image at all - what am I missing?
Can you reply what is the value of _displayedJob.Pictures[0] when you debug the data.
ASKER
Ot is the file name - something like '35 44GGY_1.jpg"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.