I have never worked with C# and I'm having problems with even the simplest tasks. I have to convert some C code into C# but also while working on a Pocket PC Device. I noticed that there are a lot of members that are not supported by the Pocket PC platform. So my question is, what is the C# code to be able to open a file on a Pocket PC?
This is what I have, but I get an error because OpenFile() is not supported by Pocket Pc:
private void butLoad_Click(object sender, EventArgs e)
{
Stream myStream;
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.InitialDirectory = "c:\\";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
if ((myStream = openFileDialog1.OpenFile()) != null)
{
// Insert code to read the stream here.
myStream.Close();
}
}
}
Any help is appreciated. If anybody knows how to open just a file in an 8-bit grey scale, that would also be helpful.
Thanks
raverPosted Jun 15, 2006, 10:48 AM
private void butLoad_Click(object sender, EventArgs e)
{
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.InitialDirectory = "c:\\";
fileDialog.Filter = "Bitmap Files (*.bmp)|*.bmp";
if (fileDialog.ShowDialog() == DialogResult.OK)
{
// Open the selected image
System.Drawing.Bitmap image = new System.Drawing.Bitmap(fileDialog.FileName);
}
}
But if anyone knows how to have the device ONLY open 8-bit grey scale images, then that would still be helpful.
thanks